Is the answer to second questoin "session.transaction.nested"?
On May 28, 1:24 pm, Kent <[email protected]> wrote: > On May 27, 6:39 pm, Michael Bayer <[email protected]> wrote: > > > commit() releases the savepoint, if thats whats going on contextually. It > > doesnt actually commit the outer transaction if you've last called > > begin_nested(). > > In a SessionExtension, 'before_commit' is called for nested > transactions, which do not actually perform a database commit, as well > as the RootTransaction, which does issue a COMMIT. > > I believe the zope guys overlooked this when they wrote their 'def > before_commit()' method of their SessionExtension, and I am going to > attempt to fix this. > > def before_commit(self, session): > assert zope_transaction.get().status == 'Committing', > "Transaction must be committed using the transaction manager" > > So my question is, first, do you call before_commit() on > SessionExtensions intentionally *even for nested transactions* which > are not performing a database commit? I assume the answer is "yes, > that is by design". > > Which leads to this question: Inside a SessionExtension's > before_commit() method, how can I work out whether this is a nested > transaction vs. the root transaction? > > Thanks, > Kent -- You received this message because you are subscribed to the Google Groups "sqlalchemy" 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/sqlalchemy?hl=en.
