Re: Behaviour of setAutoCommit may not be completely correct.

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: Markus Schaber <schabi(at)logix-tt(dot)com>, João Paulo Ribeiro <jp(at)mobicomp(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Behaviour of setAutoCommit may not be completely correct.
Date: 2006-03-31 23:31:07
Message-ID: 442DBBBB.7040409@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Tom Lane 2006-04-01 05:06:40 Re: Behaviour of setAutoCommit may not be completely correct.
Previous Message Mark Lewis 2006-03-31 17:43:45 Re: Behaviour of setAutoCommit may not be completely