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

Поиск
Список
Период
Сортировка
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 по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception