[DB-SIG] autocommit support in pep-249

Joshua D. Drake jd at commandprompt.com
Tue Sep 13 18:45:22 CEST 2011


On 09/13/2011 09:39 AM, Chris Clark wrote:
>
> Vernon Cole wrote:
>>> Properties are just the right tools for this
>>> task, and appear to be the most used solution in popular drivers.

> So I think we have 3 people each advocating slightly different options
> for what to do when changing auto commit options :-)
>
> 1. exception
> 2. commit
> 3. rollback
>

Just to throw some PostgreSQL two cents in here. It should not be legal 
to change transaction state once a transaction has begun. The "driver" 
should throw an error if that is tried. It shouldn't even reach the 
database. Consider:

conn.begin()
insert
insert

At this point we have an open transaction with two inserts pending. We 
are then going to:

conn.autocommit()?

Uh, no. The driver should throw an error and the database should remain 
waiting for next statement whether it be commit or whatever.

Sincerely,

Joshua D. Drake

-- 
Command Prompt, Inc. - http://www.commandprompt.com/
PostgreSQL Support, Training, Professional Services and Development
The PostgreSQL Conference - http://www.postgresqlconference.org/
@cmdpromptinc - @postgresconf - 509-416-6579


More information about the DB-SIG mailing list