[sqlalchemy] Re: two scoped sessions in one app?

2008-01-16 Thread Max Ischenko
I had a Session.configure() statement which was called for both sessions and this was making setup unusable. Duh. On Jan 16, 2008 2:12 PM, Max Ischenko [EMAIL PROTECTED] wrote: On Jan 15, 2008 6:14 PM, Michael Bayer [EMAIL PROTECTED] wrote: if you are using multiple scoped sessions you

[sqlalchemy] Re: two scoped sessions in one app?

2008-01-16 Thread Max Ischenko
On Jan 15, 2008 6:14 PM, Michael Bayer [EMAIL PROTECTED] wrote: if you are using multiple scoped sessions you won't be able to use Session.mapper - the idea of Session.mapper is that all instances get tied to a single contextual session. OK, so how do I set it up. I'm reading

[sqlalchemy] Re: two scoped sessions in one app?

2008-01-16 Thread Max Ischenko
Hello, Sorry for reply to myself; just want to tell that the problem is solved. Here is how my setup looks like: Session = scoped_session(sessionmaker(autoflush=True, transactional=False)) SessionCDB = scoped_session(sessionmaker(autoflush=True, transactional=False)) ... # application

[sqlalchemy] Re: two scoped sessions in one app?

2008-01-15 Thread Michael Bayer
On Jan 15, 2008, at 7:37 AM, Max Ischenko wrote: Hello, I need to access two databases from my app. I'm trying to use scoped_session helper: SessionA = scoped_session(sessionmaker(autoflush=True, transactional=False)) SessionB = scoped_session(sessionmaker(autoflush=True,