Re: Behaviour of setAutoCommit may not be completely correct.

From: "Michael Paesold" <mpaesold(at)gmx(dot)at>
To: "Markus Schaber" <schabi(at)logix-tt(dot)com>, João Paulo Ribeiro <jp(at)mobicomp(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Behaviour of setAutoCommit may not be completely correct.
Date: 2006-03-31 12:57:38
Message-ID: 023601c654c2$b1146410$7801a8c0@zaphod
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Markus Schaber write:
> João Paulo Ribeiro wrote:
>
> > From the specs: "If the value of auto-commit is changed in the middle
> > of a transaction, the current transaction is committed."
> >
> > The postgresql have a problem with setAutocommit(...): if the value
> > passed (false or true) is the same that was previously set, it just
> > does nothing.
>
> I don't see this as bug, acutally setting the value to the same it had
> previously is not "changing", strictly seen.

The latest javadoc of the Connection interface at
http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Connection.html#setAutoCommit(boolean)
has (same for 1.5.0 and 1.4.2):

setAutoCommit:
...
"NOTE: If this method is called during a transaction, the transaction is
committed."

This sentence is completely unambigously stating that calling the method
will commit a running transaction. If the postgresql jdbc driver is in
violation of this, it should be fixed. Otherwise it will break applications
that are written based on the specified semantics.

Best Regards,
Michael Paesold

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2006-03-31 13:39:36 Re: Behaviour of setAutoCommit may not be completely correct.
Previous Message Markus Schaber 2006-03-31 10:25:11 Re: Behaviour of setAutoCommit may not be completely correct.