I am wondering which of these is the better pattern to use:

metadata = MetaData()
engine = create_engine(DEV_URL, echo=False,pool_size=1)
Session = scoped_session(sessionmaker(bind=engine))
session = Session()

or:

metadata = MetaData()
engine = create_engine(DEV_URL, echo=False,pool_size=1)
Session = scoped_session(sessionmaker())
session = Session()
metadata.bind = engine

I am leaning towards the first. Where I work, we are in the middle of
working on a project to split our data over mulitple database servers.
As a result, I thought it would be better to have one session per
database. If I am understanding correctly, I can then use one table
definition to query against different database sessions.

thanks,
Matt
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to