[TransWarp] SQL Connection doesn't join Transaction

Phillip J. Eby pje at telecommunity.com
Wed Mar 5 09:34:12 EST 2003


At 01:20 PM 3/5/03 +0100, Ulrich Eck wrote:
>what is the right way to:
>1. use the peak.storage sytem that this change is not needed
>or

When you execute SQL that needs to be in a transaction, include 
'joinTxn=True' in the keyword arguments to the call, e.g.:

someConn('UPDATE something WHERE theother=whatever', joinTxn=True)


>2. make changes that ensure a connection joins the Transaction
>whenever it is used and supports transactions.

For some apps and some connections, this is a bad idea.  See:

http://www.eby-sarna.com/pipermail/transwarp/2003-January/000277.html

Note, by the way, that it's safe for the SQL connection to not actually 
join the transaction until the DM is flushing because of 
'storage.commit()'.  Just be sure that any SQL you want to be in a 
transaction either includes 'joinTxn=True', or is known to be issued after 
a 'joinTxn=True' call has been made in that PEAK transaction.




More information about the PEAK mailing list