[DB-SIG] Python 2.0 DB Api - Threading and Transactions not known until connected

M.-A. Lemburg mal@lemburg.com
Sat, 28 Aug 1999 16:44:06 +0200


Brad Clements wrote:
> 
> On 27 Aug 99, at 12:53, Hernán Martínez Foffani wrote:
> 
> > > 4. Hence, users that never call commit(), can not really use the DB
> > > because none of their changes will ever be saved.
> > well, they CAN use it. As a matter of fact it is a trick that many
> > programmers, me included, use: You can "try and see (and time!)"
> > different algorithms in production environment safely.
> >
> > >
> > > Is this correct? Should I therefore assume that all DB users will
> > > ALWAYS call connection.commit (or  rollback), and that NO ONE will
> > > ever try to use the DB without using connection.commit?
> > Don't forget that users can turn AutoCommit ON.
> 
> Ok, I see. If they don't turn on auto-commit, and if they don't call
> connection.commit, then their changes are rolled back when closing the
> connection.
> 
> But .. the mechanism to enable auto-commit is not documented in the
> DB spec. Should a standard be defined for 2.1 of the spec?

The 2.0 spec says that connections may provide a method to
control auto-commit. Nothing more. I don't think that the
spec should really go into details here, because auto-commit
and transaction handling in general are database specific
(e.g. there are quite a few different transaction isolation levels
which a data source can implement).

-- 
Marc-Andre Lemburg
______________________________________________________________________
Y2000:                                                   127 days left
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/