On Nov 8, 2009, at 6:48 AM, James wrote:
> > On Nov 7, 5:28 pm, Michael Bayer <mike...@zzzcomputing.com> wrote: >> the most obvious cause would be that two different engines are being >> used, since sqlite memory databases are local only to a single >> connection. > > Thanks for this pointer Michael! > > I tried putting extra logging in the _cursor_execute method of > sqlalchemy.engine.base.py to see which connection is being used for > various statements, and it seems that different > sqlalchemy.engine.base.Connection objects are being used even during > my first test, which works as expects. > > I think I must be looking in the wrong place to see which connection > is being used for each statement; can you tell me the best way to get > my hands on the current connection? I was using context.connection in > the _cursor_execute method... i would think you need to get a hold on where "create_engine" is being called twice. if your connection is sqlite "memory", there should only be one engine in use throughout the appication. the engine with sqlite will use a "thread local" connection strategy such that each call to connect() on the same engine produces the same connection within the same thread. > > James > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---