Re: Disable Transaction - plans ? - Mailing list pgsql-general

From Mike Mascari
Subject Re: Disable Transaction - plans ?
Date
Msg-id 3BD76761.532AC5D3@mascari.com
Whole thread Raw
In response to Re: Disable Transaction - plans ?  ("Dominic J. Eidson" <sauron@the-infinite.org>)
List pgsql-general
Tom Lane wrote:
>
> Thomas Lockhart <lockhart@fourpalms.org> writes:
> > There is a client-side termination handshake, and it could be tied to
> > that. If we can distinguish between an intentional exit and an
> > unexpected termination, then istm that a commit would be safe to apply
> > for the former.
>
> I assert that we cannot safely determine that; it's too easy for a
> client logic error to tell libpq to close the connection at the wrong
> time, and we should NOT default to committing when that happens.
>
> I think a client using this mode should be expected to send an explicit
> commit command before exiting.

With respect to Oracle, use of the libpq's equivalent to PQFinish(),
OCISessionEnd(), implicitly issues a COMMIT before disconnecting, so
it appears to be the client's responsibility wrt Oracle. SQL*Plus
users will note that, if their SQL*Plus session is exited normally
via the QUIT command, their work will also be committed, since it is
probably just calling OCISessionEnd() itself. So would it be
possible to modify PQFinish() to examine whether autocommit = true,
and if so, issue a commit before disconnect, else just disconnect?

Mike Mascari
mascarm@mascari.com

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Disable Transaction - plans ?
Next
From: "Marc G. Fournier"
Date:
Subject: Re: CVS server stumbling?