From: Craig Ringer <craig@postnewspapers.com.au>
To: emilu@encs.concordia.ca
Cc: pgsql-jdbc@postgresql.org
Subject: Re: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception
Date: Wed, 01 Jun 2011 08:18:51 +0800
Message-ID: <4DE5856B.9000206@postnewspapers.com.au> (raw)
In-Reply-To: <4DE52047.5030900@encs.concordia.ca>
References: <4DE52047.5030900@encs.concordia.ca>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: craig@postnewspapers.com.au, emilu@encs.concordia.ca
Subject: Re: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception
In-Reply-To: <4DE5856B.9000206@postnewspapers.com.au>
References: <4DE52047.5030900@encs.concordia.ca> <4DE5856B.9000206@postnewspapers.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox