On Dec 16, 2010, at 7:02 AM, Ralph Heinkel wrote: > Hi Michael and others, > > we are about upgrading from SA 0.5 to SA 0.6, and some of our code is failing > because it was expecting to obtain a transaction obj from engine.begin() (for > threadlocal engines). In SA 0.4 this even returned a context manager so that > we were able to do > > with engine.begin(): > ... some transactions ... > > Has this been removed for some purpose? I found it very useful, and it fits > with sessions where you can write > > with Session.begin(): > ... some transactions ...
The reason that change happened is because the logic of the threadlocal engine was changed to no longer support the mixing of explicit Transaction objects in conjunction with the "thread-scoped" transaction of the thread local engine. It was the returned Transaction object that implemented __exit__() which is why the context manager feature worked. That the reworked threadlocal engine no longer returned any object at all and therefore was no longer a context manager amounts to the inadvertent removal of a desirable behavior. > > > So will this be the future behaviour of engine.begin() that it returns just > None? its not a big deal for TLEngine to return some dummy object that emits a commit/rollback from begin() so ticket 2004 has been added for this. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@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.