Am Dienstag, 3. Juni 2008 12:21 schrieb Laurence Rowe:
> Laurence Rowe wrote:
> >> I found it by myself: I registered a zope.sqlalchemy related utility,
> >> which stores an engine (self.engine = create_engine(DSN,...)) and a
> >> scoped session (self.Session = scoped_session(sessionmaker...)). These
> >> two objects cannot be serialized, hence the above problem.
> >>
> >> Now I'm unsure what to do about this problem - is there any code
> >> available that demonstrates how to register SA engines/Sessions as
> >> utilities?
> >
> > The simplest solution is to register the Session object as a global
> > utility.
>
> Though that would be quite unnecessary too ;-). If you are ok with one
> global scoped session for your app, then just use `from mymodule import
> Session; session = Session()`.

Hmmm, it's not that easy: I have multiple sites on one Zope3 instance, whereas 
every site should connect to another database. For that reason, I thought 
about a local utility. However, this results in this serialization error.

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to