For the record, this was resolved. I didn't know how to set up the
second session object.
On Jun 5, 2:06 pm, percious <ch...@percious.com> wrote:
> It's not too bad, but you have to do your own custom app setup, and
> modify your init_model stuff to create multiple transaction manager.
> from webapp.model import init_model
> class MyAppConfig(AppConfig):
> # Pass the engine to initmodel, to be able to introspect
> base_config = MyAppConfig()
> import model.users
> from model.users.mappers import *
> from zope.sqlalchemy import ZopeTransactionExtension
> # Global session manager. DBSession() returns the session object
> DBSession = UsersDBSession = scoped_session(maker)
> SamplesDBSession = scoped_session(maker3)
> def init_model(users_engine, samples_engine):
> global UsersDBSession, SamplesDBSession, users_metadata,
> users_metadata.bind = users_engine
> This is sort of an off-the cuff answer, we will provide a better one
> Come find me on IRC if you need some more help.
> On Jun 4, 10:31 am, Mike Driscoll <kyoso...@gmail.com> wrote:
> > Hi,
> > According to Mark Ramm's blog, supporting multiple databases is
> > I "think" I need to put multiple sqlalchemy.url's in my
> > I'm pretty sure the init_model came from Perkins. Maybe he can tell me
> > That would be great!
> > Thanks,
> > Mike
> > On May 28, 12:47 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
> > > Hi,
> > > I am having a little trouble wrapping my head around how to configure
> > > I assume I need to comment out this line:
> > > metadata = DeclarativeBase.metadata
> > > and instead create three metadata instances based on MetaData(),
> > > Finally, as I understand it, I can use the "init_model" function to do
> > > Hopefully that stuff makes sense. I am using Python 2.5 and TG2 in a
> > > Thanks!
> > > Mike
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.