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
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
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
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