Re: Behaviour of setAutoCommit may not be completely correct. - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Behaviour of setAutoCommit may not be completely correct.
Date
Msg-id 442DBBBB.7040409@opencloud.com
Whole thread Raw
In response to Re: Behaviour of setAutoCommit may not be completely correct.  ("Michael Paesold" <mpaesold@gmx.at>)
Responses Re: Behaviour of setAutoCommit may not be completely correct.
List pgsql-jdbc
Michael Paesold wrote:

> 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.

Note that this is new to the JDBC3 javadoc. The JDBC2 javadoc doesn't
have that note.

The main spec (e.g. the JDBC 3.0 PDF) document is unambiguous, too, but
describes different behaviour:

> The default is for auto-commit mode to be enabled when the Connection
> object is created. If the value of auto-commit is changed in the middle
> of a transaction, the current transaction is committed.

The specification behaviour is what the driver implements (it sounds
like Oracle did the same thing too).

Does the specification trump the javadoc, or vice versa?

-O

pgsql-jdbc by date:

Previous
From: Mark Lewis
Date:
Subject: Re: Behaviour of setAutoCommit may not be completely
Next
From: Tom Lane
Date:
Subject: Re: Behaviour of setAutoCommit may not be completely correct.