[sqlalchemy] Re: transaction deadlock in sqlalchemy connection transactions

2007-07-16 Thread Michael Bayer
On Jul 15, 2007, at 11:19 PM, SamDonaldson wrote: Say I used the threadlocal strategy here. What would the effect of the following nested calls since I use a decorator? Would it detect and use the same connection and the same top level transaction? engine.begin() do something

[sqlalchemy] Re: transaction deadlock in sqlalchemy connection transactions

2007-07-15 Thread jason kirtland
SamDonaldson wrote: [...] I have defined a transaction decorator: def transaction(func): def do(*args, **kw): connection = engine.connect() transaction = connection.begin() try: # create some context here for the connection and pass it through to

[sqlalchemy] Re: transaction deadlock in sqlalchemy connection transactions

2007-07-15 Thread SamDonaldson
I see the problem here. So what you're saying is that I need some way of knowing what the parent connection object was to pass through the decorators and the execute for the nested txn's should happen on the same connection object. My follow up question is: how do people usually implement this

[sqlalchemy] Re: transaction deadlock in sqlalchemy connection transactions

2007-07-15 Thread SamDonaldson
Say I used the threadlocal strategy here. What would the effect of the following nested calls since I use a decorator? Would it detect and use the same connection and the same top level transaction? engine.begin() do something engine.commit() else engine.rollback() Thanks for your help in