[DB-SIG] Behaviour of .commit()/.rollback() when autocommit=True
gh at ghaering.de
Mon Nov 17 10:44:25 EST 2003
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?
More information about the DB-SIG