Thanks for the detailed explanation, Mike. I missed the fact that the Connection gets created at different times in the two scenarios.
As expected, moving the echo=True line to just after the commit gives the same result in both scenarios. Regards, Vinay Sajip P.S. I'm reposting this, Google seems to have swallowed my earlier attempt to respond - trying via gmane now. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.