Re: Behaviour of setAutoCommit may not be completely correct.

From: Kris Jurka <books(at)ejurka(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Oliver Jowett <oliver(at)opencloud(dot)com>, Michael Paesold <mpaesold(at)gmx(dot)at>, 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-04-01 08:07:11
Message-ID: Pine.BSO.4.63.0604010303390.13853@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Sat, 1 Apr 2006, Tom Lane wrote:

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

The JDBC 4.0 public draft spec says:

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. If setAutoCommit is
called and the value for auto-commit is not changed from its current
value, it is treated as a no-op.

The JDK1.6 beta2 javadoc confirms this:

NOTE: If this method is called during a transaction and the auto-commit
mode is changed, the transaction is committed. If setAutoCommit is called
and the auto-commit mode is not changed, the call is a no-op.

So I think we're fine.

Kris Jurka

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message babu_moshay 2006-04-02 05:01:24 25P02, current transaction is aborted, commands ignored until end of transaction block
Previous Message Tom Lane 2006-04-01 05:06:40 Re: Behaviour of setAutoCommit may not be completely correct.