Re: Cannot commit when autoCommit is enabled error

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: Gurkan Ozfidan <gurkan(at)timeforgedev(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Cannot commit when autoCommit is enabled error
Date: 2013-09-18 09:25:13
Message-ID: 1379496313.51692.YahooMailNeo@web162904.mail.bf1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Gurkan Ozfidan <gurkan(at)timeforgedev(dot)com> wrote:

>ERROR in createReportTable(): Cannot commit when autoCommit is enabled.

>PART OF THE CODE:

>        } catch (Exception e) {
>            System.err.println("ERROR in runStorageSQLQuery(): " + e.getMessage() + " sqlQuery: "+sqlQuery);
>            e.printStackTrace();

It may be part of the code, but it's not the part that is throwing
the exception.

FWIW, the JDBC API requires that the driver throw an exception if
you try to invoke Connection.commit() on a connection which is in
autoCommit mode.  Older versions of the PostgreSQL JDBC driver
failed to do that; newer ones comply with that requirement.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jayadevan M 2013-09-18 10:00:56 Moving from 9.2 to 9.3
Previous Message Kevin Grittner 2013-09-18 09:02:59 Re: upgrade from 9.2.x to 9.3 causes significant performance degradation