Trying to rollback a transaction ends with an error because TG
ultimately trys to commit it. I found and workaround in a thread here,
but I'm wondering if TG could check the state of a transaction and not
attempt a commit if the transaction is not active.  Transaction has an
attribute is_active that I believe could be useful for this.  I'm not
sure of the best way to access it, but I found it playing around like
this:

trans.connections.values()[0][1].is_active

where trans is returned from session.create_transaction

I'm thinking TG could do something like this:

if transaction.is_active:
    session_trans.commit()
else:
    # need to do anything ?
    pass


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