[sqlalchemy] Re: session.flush() closing connection

2006-10-30 Thread François Wautier
Hi Michael, Thanks... Indeed it works... As long as I am careful and close the session after every flush (Something that make sense in the little application I am writing) several non concurrent threads can access and use the session. Cool Cheers, François > François Wautier wrote: >

[sqlalchemy] Re: session.flush() closing connection

2006-10-21 Thread Michael Bayer
François Wautier wrote: > I moved the "connect" to the method handling the data and the problem > disappeared. yeah "connect()" should generally be localized as much as possible. > > It would be easy enough to make sure all the "flushes" are done in a single > thread of execution, but can you

[sqlalchemy] Re: session.flush() closing connection

2006-10-21 Thread François Wautier
Hi Michael, Thanks for the answers. > also, when you say you "triggered" the problem, can you do that > predictably ? can you send a small test program that does it every > time ? otherwise it sounds like a threading thing (if thats at all > possible). > Very much so. Everytime I run my budd

[sqlalchemy] Re: session.flush() closing connection

2006-10-21 Thread Michael Bayer
also, when you say you "triggered" the problem, can you do that predictably ? can you send a small test program that does it every time ? otherwise it sounds like a threading thing (if thats at all possible). On Oct 21, 2006, at 6:18 AM, François Wautier wrote: > > Hi Michael, > > Nope!

[sqlalchemy] Re: session.flush() closing connection

2006-10-21 Thread Michael Bayer
is there any chance the Connection youre using is being shared between threads ? thats also not supported. On Oct 21, 2006, at 6:18 AM, François Wautier wrote: > > Hi Michael, > > Nope! Nothing of that sort. I couldn't care less about transaction > at this > point. > > All I do is > >

[sqlalchemy] Re: session.flush() closing connection

2006-10-21 Thread François Wautier
Hi Michael, Nope! Nothing of that sort. I couldn't care less about transaction at this point. All I do is self.dbEng=sqlalchemy.create_engine(myurl,strategy='threadlocal') #debug self.dbEng.echo=True try: self.dbConn=self.dbEng.connect()

[sqlalchemy] Re: session.flush() closing connection

2006-10-20 Thread Michael Bayer
hey François - are you using the SessionTransaction explicitly ? or connection.begin () ? Ive tried many combinations, and the only way I can reproduce the problem is by doing something incorrect: c = engine.connect() s = create_session(bind_to=c) tran = c.begin

[sqlalchemy] Re: session.flush() closing connection

2006-10-20 Thread François Wautier
Hi Michael, It seems I spoke too quickly. The problem is now when I try to flush a second time with a new object. Something like this newguy=dbPeople() session.save(newguy) newguy.Lastname="Doe" newguy.Firstname="John" newguy.gender="Ambiguous"

[sqlalchemy] Re: session.flush() closing connection

2006-10-19 Thread François Wautier
Thanks for the patch... it works... so far And sorry for the double post... my original email was held for a very long time on some google host Cheers, François > thats a bug. its because the flush() is closing the "connection" you > passed to your session. > > heres a patch that fix

[sqlalchemy] Re: session.flush() closing connection

2006-10-18 Thread Michael Bayer
thats a bug. its because the flush() is closing the "connection" you passed to your session. heres a patch that fixes it, which i will try to commit later today but i want to work up some test cases: Index: lib/sqlalchemy/orm/session.py ==