Re: Bug: Transaction still open after error when autocommit=true - Mailing list pgsql-jdbc

From Dave Cramer
Subject Re: Bug: Transaction still open after error when autocommit=true
Date
Msg-id CADK3HHJ8TpocbPD7=HKP0AKmFV9nFUqB5dwjPCULuC1v+kJucg@mail.gmail.com
Whole thread Raw
In response to Re: Bug: Transaction still open after error when autocommit=true  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-jdbc
Clearly the exception that is thrown when you try to rollback is that
autocommit is on.

I don't really see this as a bug.

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca



On Thu, Dec 22, 2011 at 6:29 PM, Kevin Grittner
<Kevin.Grittner@wicourts.gov> wrote:
> Daniel Migowski <dmigowski@ikoffice.de> wrote:
>
>> A small demo for the bug is attached.
>
> The javadocs for Connection:
>
> http://docs.oracle.com/javase/6/docs/api/java/sql/Connection.html
>
> say:
>
> | JDBC applications should use the appropritate Connection method
> | such as setAutoCommit or setTransactionIsolation. Applications
> | should not invoke SQL commands directly to change the connection's
> | configuration when there is a JDBC method available.
>
> I take that to mean that the right way to do this is to set
> autoCommit to false and use the connection's commit() method.  If
> you do it that way, is there a problem?
>
> -Kevin
>
> --
> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-jdbc

pgsql-jdbc by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Bug: Transaction still open after error when autocommit=true
Next
From: Oliver Jowett
Date:
Subject: Re: Bug: Transaction still open after error when autocommit=true