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,  
> transactional=False))
> ...
> mapper(SessionA.mapper, ClassFromA ...)
> mapper(SessionB.mapper, ClassFromB ...)
>
> But when I try to query against SessionA it looks for a table_a in  
> database B. How do I separate two sessions properly?
>


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. 
   

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to