Re: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception - Mailing list pgsql-jdbc

On 06/01/2011 01:07 AM, Emi Lu wrote:

> When update/insert/delete is called, always got:
> ===================================================
> ### Error committing transaction. Cause:
> org.postgresql.util.PSQLException: Cannot commit when autoCommit is
> enabled.

Sounds like MyBatis expects autocommit to be disabled because it does
its own explicit BEGIN/COMMIT, but you've got it turned on. The newer
JDBC driver detects this and complains about it, where the older one
presumably ignored a COMMIT issued while in autocommit mode.

Add "autoCommit=false" to your connection parameters.

"autoCommit" doesn't appear to be documented in
http://jdbc.postgresql.org/documentation/head/connect.html#connection-parameters
, which is surprising.

--
Craig Ringer

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception
Next
From: Oliver Jowett
Date:
Subject: Re: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception