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

From: Emi Lu <emilu(at)encs(dot)concordia(dot)ca>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception
Date: 2011-05-31 17:07:19
Message-ID: 4DE52047.5030900@encs.concordia.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello list,

. Postgresql8.3

. mybatis-3.0.5-SNAPSHOT.jar
. mybatis-spring-1.0.1-SNAPSHOT.jar
. spring3.0.5

. postgresql-9.0-801.jdbc4.jar

SqlSession sql_session = sqlSessionFactory.openSession(false);
....
sql_session.commit();

applicationContext-mybatis.xml

<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="${driverClassName}" />
<property name="url" value="${url}" />
<property name="username" value="${username}" />
<property name="password" value="${password}" />
</bean>

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

While for "8.4-702 JDBC 4", the same codes, no error at all.

Is there anything need to be configured if using
"postgresql-9.0-801.jdbc4.jar"?

Thanks a lot!
Emi

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Emi Lu 2011-05-31 18:11:52 "postgresql-9.0-801.jdbc4.jar" Causing "Error committing transaction. Cause: org.postgresql.util.PSQLException: Cannot commit when autoCommit is enabled." Exception
Previous Message Tom Lane 2011-05-31 14:10:22 Re: PreparedStatement error for date parameter with overlaps