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

From Tom Lane
Subject Re: Behaviour of setAutoCommit may not be completely correct.
Date
Msg-id 7738.1143868000@sss.pgh.pa.us
Whole thread Raw
In response to Re: Behaviour of setAutoCommit may not be completely correct.  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Behaviour of setAutoCommit may not be completely correct.  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Oliver Jowett <oliver@opencloud.com> writes:
> Does the specification trump the javadoc, or vice versa?

The spec certainly ought to win, but the fact that the change in the
javadoc is more recent is a pretty clear clue what Sun thinks.
You quote the spec text as

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

I don't see that as unambiguous.  If the autocommit setting is *changed*
then it's clear what must happen, but calling the method with the same
setting that already prevails could easily be considered not to cause
a "change" in the setting.

It looks to me like Sun is trying to clarify their reading of that
detail with the javadoc change.  It's a crummy way to handle it; they
should have updated the spec.  But I'd say the handwriting is on the
wall about what the next spec version will say.

Is it reasonable to provide an option about how to handle this case?

            regards, tom lane

pgsql-jdbc by date:

Previous
From: Oliver Jowett
Date:
Subject: Re: Behaviour of setAutoCommit may not be completely correct.
Next
From: Kris Jurka
Date:
Subject: Re: Behaviour of setAutoCommit may not be completely correct.