BEGIN Behaviour - Mailing list pgsql-odbc

From Constantin S. Svintsoff
Subject BEGIN Behaviour
Date
Msg-id Pine.BSF.4.21.0102131736560.56545-100000@localhost
Whole thread Raw
List pgsql-odbc
hello, there!

I think correct behaviour for issuing BEGIN in ODBC is:

 All the statements that are issued when autocommit is off should
be executed inside transaction block, because there is no
possibility to determine if particular statement modifies database
state or no. (SELECT can be used to execute stored procedure
that modifies database state, etc. It would be very bad if
changes made by such SELECT will be rolled back if there was
some INSERT/UPDATE/DELETE, etc, before it, and not rolled back
if no).

So I think it would be correct to issue BEGIN in SQLSetConnectAttr what
sets autocommit off, and in SQLEndTran after COMMIT or ROLLBACK.
And issue COMMIT in SQLSetConnectAttr that sets autocommit ON.

P.S. Sorry for my poor English

/Constantin


pgsql-odbc by date:

Previous
From: Dave Page
Date:
Subject: RE: RE: [INTERFACES] 7.1 beta 3 Linux ODBC BEGINBehaviour
Next
From: Tom Lane
Date:
Subject: Re: RE: [INTERFACES] 7.1 beta 3 Linux ODBC BEGINBehaviour