Re: Patch for handling "autocommit=false" in postgresql.conf

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Patch for handling "autocommit=false" in postgresql.conf
Дата
Msg-id 200209180501.g8I51Fg29670@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Patch for handling "autocommit=false" in postgresql.conf  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-jdbc
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.

Sorry to be blocking that change but I can see no reason to special case
SET to not start a new transaction, especially since we added SET to be
rollbackable in 7.3.  If we hadn't done that, you easily could make a
case for it because the SET would behave without transaction semantics.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Al Sutton
Дата:
Сообщение: JDBC API Tests
Следующее
От: "Michael Paesold"
Дата:
Сообщение: JDBC and fetching the OID of an insert