[DB-SIG] Transactions: how to start them?

Greg Stein gstein@microsoft.com
Thu, 18 Sep 1997 01:48:33 -0700


Actually, as I seem to recall, the execute didn't actually do the
commit... it was when the cursor was closed. Seems like I ran into a
problem where a cursor object was left around causing an INSERT to not
be committed, thereby causing all kinds of pain. It was solved by simply
deleting the reference to the cursor, but it may be a gotcha to watch
out for.

-g

-----Original Message-----
From:	Bill Tutt 
Sent:	Wednesday, September 17, 1997 11:45 AM
To:	'Andrew Kuchling'; db-sig@python.org
Subject:	RE: [DB-SIG] Transactions: how to start them?

Erm.. just to be annoying.. ODBC drivers default to autocommiting every
SQL statement that's executed.
You have to explicitly tell the ODBC driver to turn autocommiting off.

Currently (as an obnoxious hack) the PythonWin ODBC interface has a
setautocommit() method that you can call to turn off autocommiting after
every cursor.execute().

Does this sound like a useful feature or should the ODBC module be
tweaked to automatically turn off the ODBC driver's autocommit feature?

Bill

> -----Original Message-----
> From:	Andrew Kuchling [SMTP:amk@magnet.com]
> Sent:	Wednesday, September 17, 1997 10:34 AM
> To:	db-sig@python.org
> Subject:	Re: [DB-SIG] Transactions: how to start them?
> 
> "W. Craig Trader" <ct7@unicornsrest.org> wrote:
> >For a typical database, when you open a connection, you've started a
> >transaction; when the connection is closed the database will either
> commit
> >or rollback (it depends upon the database) the transaction.  If you
> choose
> 
> 	OK; thanks!  I think it would be a good idea to make this
> explicit in the DB-API specification.
> 
> >Illustra commits by default; MySQL and mSQL don't support
> transactions at
> >all.  Those are the only databases I've used that have Python
> interfaces
> >(and none of those interfaces use the DB-API).
> 
> 	Since it was decided to keep the DB-SIG alive under Michael
> McLay's ownership, what's the SIG's mission now?  At the time of the
> switch, Michael wrote:
> 
> >I'd like to keep it alive, so I'll take over as the sig champion.  I
> >think it needs to stay open until a few more databases are compliant
> >with the db interface standard.  (In particuular the mSQL interface
> 
> 	I'm working on an LJ article about the API; if it gets
> finished in time and accepted, it'll appear in February.  That would
> give us some time to improve the text of the DB-API spec, and possibly
> to make the mSQL, mySQL, and/or Postgres95 interfaces compliant with
> it.  The list of supported databases needs to be more impressive. :)
> 
> 
> 	Andrew Kuchling
> 	amk@magnet.com
> 	http://starship.skyport.net/crew/amk/
> 
> 
> _______________
> DB-SIG  - SIG on Tabular Databases in Python
> 
> send messages to: db-sig@python.org
> administrivia to: db-sig-request@python.org
> _______________

_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________

_______________
DB-SIG  - SIG on Tabular Databases in Python

send messages to: db-sig@python.org
administrivia to: db-sig-request@python.org
_______________