You're right, it does, but that's the problem you're experiencing (or, at least, look like you are).
Here's what happens: transaction.begin() DBSession.add() DBSession.delete() transaction.commit() Now, the object has been added to the session, but not to the database. The delete tries to delete the object from the database (delete from tablex ...), but is unable to because the item never made it to the database. End result is an exception. At least, that's what it looks like from the traceback. On Wed, Jan 4, 2012 at 10:33 AM, pkraus <[email protected]> wrote: > Thanks. I think that was it but i won't know for sure until its been > running for a bit. > > I thought that the way TG is setup the session (even after the add) didn't > do anything until transaction was comitted (after the controller finishes). > > So that ... > instance = Object() > DBSession.add(instance) > DBSession.delete(instance) > > Would in fact all happen before any actual commits. > > > > -- > You received this message because you are subscribed to the Google Groups > "TurboGears" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/turbogears/-/4GZ9CN4sJ30J. > > 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. > -- Michael J. Pedersen My Online Resume: http://www.icelus.org/ -- Google+ http://plus.ly/pedersen Google Talk: [email protected] -- Twitter: pedersentg -- 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.

