Sqlalchemy with different application scenarios

0 views
Skip to first unread message

karik...@gmail.com

unread,
Dec 23, 2009, 10:11:46 PM12/23/09
to sqlalchemy
I have this scenario.

I have two libraries developed independently using SQLAlchemy. each
library has its own model, own session connection. Now I have
application using those two libraries. Application has its own models.
application is having its own session.

Data stored into the same database (mysql).

In my application, I want to do some query operation which requires
the library 1 models to be used as part of the application 1 session.
But Library 1 model already binded with library 1 session/meta. How
can I associate a model which connected to other session into
application session?

Regards,

Krish

Michael Bayer

unread,
Dec 27, 2009, 11:09:52 AM12/27/09
to sqlal...@googlegroups.com


I'd probably make the two libraries use the same common session, that of the application. a "model" doesn't need to define its own session.

karik...@gmail.com

unread,
Dec 28, 2009, 9:34:05 AM12/28/09
to sqlalchemy
Is that mean, having separate session per library and one application
session which combines both is not possible at this moment?

So keeping them at the application level may help me at this point of
time.

Thank you for suggestion.

Regards,

Krish

On Dec 27, 9:09 pm, Michael Bayer <mike...@zzzcomputing.com> wrote:

Reply all
Reply to author
Forward
0 new messages