[DB-SIG] Behaviour of .commit()/.rollback() when autocommit=True
TKeating at origin.ea.com
Mon Nov 17 10:47:17 EST 2003
These should do exactly what they do now when called on a session that has nothing to commit or rollback.
From: db-sig-bounces at python.org [mailto:db-sig-bounces at python.org] On Behalf Of Gerhard Häring
Sent: Monday, November 17, 2003 9:44 AM
To: db-sig at python.org
Subject: [DB-SIG] Behaviour of .commit()/.rollback() when autocommit=True
Several database modules seem to have a sort of unofficial extension - the autocommit mode, without transaction handling. I'd like to hear your opinion on what .commit()/.rollback() should do in this case.
Behaviour: .commit() dies nothing, .rollback() raises an exception
Rationale: this makes it easier to program applications that work in both autocommit mode and transactional mode, depending on the configuration or DB-API module used.
Behaviour: .commit() and .rollback() both raise an exception
Rationale: There is nothing to commit or roll back, so these calls don't make any sense and the user should be alerted of this fact.
Behaviour: .commit() and .rollback() both do nothing.
Rationale: (Almost) same as #1?
Do you have any other suggestions? Which would you prefer?
DB-SIG maillist - DB-SIG at python.org
More information about the DB-SIG