cant u cache all these objects elsewhere then sess.merge() them? On Monday 24 November 2008 22:33:53 Koen Bok wrote: > Ok, that sounds logical, but that defeats the purpose of it for me > :-) > > Whenever a Checkout user logs out I clear the session. On a new > login I create fresh session that has to re-cache lot of data. The > logins depend on a valid postgres user. If I could find a way to > replace the engine/connection for a session it would keep the > objects around, making login way faster the second time. > > Any ideas? :-) > > - Koen > > On Nov 24, 4:51 pm, "Michael Bayer" <[EMAIL PROTECTED]> wrote: > > that is the way to do it as far as switching engines. your > > example doesn't work because the state of "p1" is "persistent" as > > opposed to "pending", so the example updates a row that isn't > > there. > > > > you need to build a copy constructor on Person and make a new, > > non-persistent Person object for your second engine. the > > Session can't implicitly figure out what your intent is. > > > > Koen Bok wrote: > > > Hey I was wondering if it was possible to replace an engine in > > > a session. It does not seem to work, but maybe I'm doing > > > something really stupid. > > > > > >http://pastie.org/322501 > > > > > > Kindest regards, > > > > > > Koen Bok - madebysofa.com > >
--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---