Re: Patch for handling "autocommit=false" in postgresql.conf - Mailing list pgsql-jdbc

From snpe
Subject Re: Patch for handling "autocommit=false" in postgresql.conf
Date
Msg-id 200209171824.21683.snpe@snpe.co.yu
Whole thread Raw
In response to Re: Patch for handling "autocommit=false" in postgresql.conf  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-jdbc
On Tuesday 17 September 2002 04:26 pm, Tom Lane wrote:
> snpe <snpe@snpe.co.yu> writes:
> > +               // handle autocommit=false in postgresql.conf
> > +                if (haveMinimumServerVersion("7.3")) {
> > +                               ExecSQL("set autocommit to on; commit;");
> > +               }
>
> The above will fill people's logs with
>     WARNING:  COMMIT: no transaction in progress
> if they don't have autocommit off.
>
> Use
>     begin; set autocommit to on; commit;
> instead.
>
> I would recommend holding off on this patch altogether, actually,
> until we decide whether SET will be a transaction-initiating
> command or not.  I would still like to persuade the hackers community
> that it should not be.

if set 'begin; setautocommit to on; commit;'
this is work no matter autocommit on or off and whether SET initiate
transaction or not.
We can yet query database for transaction (on or off), but this is not
important (we must autocommit=true for jdbc spec).

regards
haris peco

pgsql-jdbc by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: NOTICE causing SQLException
Next
From: Al Sutton
Date:
Subject: JDBC API Tests