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

From Tom Lane
Subject Re: Patch for handling "autocommit=false" in postgresql.conf
Date
Msg-id 23695.1032272774@sss.pgh.pa.us
Whole thread Raw
In response to Patch for handling "autocommit=false" in postgresql.conf  (snpe <snpe@snpe.co.yu>)
Responses Re: Patch for handling "autocommit=false" in postgresql.conf
Re: Patch for handling "autocommit=false" in postgresql.conf
List pgsql-jdbc
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.

            regards, tom lane

pgsql-jdbc by date:

Previous
From: snpe
Date:
Subject: Patch for handling "autocommit=false" in postgresql.conf
Next
From: Daniel Serodio
Date:
Subject: NOTICE causing SQLException