On Apr 16, 2007, at 10:47 PM, Janzert wrote:

>>
>> Index: turbogears/database.py
>> ===================================================================
>> --- turbogears/database.py      (revision 2824)
>> +++ turbogears/database.py      (working copy)
>> @@ -336,7 +336,8 @@
>> [run_with_transaction.when("_use_sa()")]
>> def sa_rwt(func, *args, **kw):
>>       log.debug("New SA transaction")
>> -    transaction = session.create_transaction()
>> +    req = cherrypy.request
>> +    transaction = req.sa_transaction = session.create_transaction()
>>       try:
>>           retval = func(*args, **kw)
>>           transaction.commit()
>>
>> Alberto
>>
>
> It would be nice if instead of holding onto a local reference to the
> transaction it used the one in the request object to commit and  
> rollback
> (i.e. get rid of the transaction variable above and change all
> references to req.sa_transaction). I believe this would solve the
> problem where people want to be able to rollback the transaction and
> then start a new one within a controller.

Good point. Mind posting opening a tickjet at the Trac with a patch?

Thanks,
Alberto

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to