Thanks again. Let me see if I understood this correctly. What I tried to do initially is use implicit connections that I have no control over. The transaction was started on my explicit connection but the inserts used a different connection from the pool and therefore were not aware of the transaction. Right?
On Jul 29, 12:12 am, Michael Bayer <[EMAIL PROTECTED]> wrote: > discussion starts here: > > http://www.sqlalchemy.org/docs/dbengine.html#dbengine_connections > > covers some options available to you including using a "thread local" > connection. > > On Jul 28, 2007, at 5:07 PM, mc wrote: > > > > > Thanks. > > Can you point me to the place in the doc where this is discussed? > > I was under the impression that I had one connection only in this > > scenario. > > > TIA > > > On Jul 28, 11:09 pm, Michael Bayer <[EMAIL PROTECTED]> wrote: > >> On Jul 28, 2007, at 2:54 PM, mc wrote: > > >>> md=BoundMetaData(db) > >>> t=Table('test', md, autoload = True) > > >>> trans = cn.begin() > >>> try: > >>> insert(t).execute(id=332) > >>> insert(t).execute(id=332) > >>> trans.commit() > >>> except: > >>> trans.rollback() > >>> raise > > >> the statements must be executed relative to the connection which > >> contains the transaction: > > >> cn.execute(insert(t), id=332) --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---