[Zope-dev] Strange serializing error when commiting -> zope.sqlalchemy

Hermann Himmelbauer dusty at qwer.tk
Mon Jun 2 19:10:12 EDT 2008


Am Montag, 2. Juni 2008 20:04 schrieb Hermann Himmelbauer:
> Hi,
> In my zope3 tests, I set up some basic test data. After that, I'm calling
> transaction.commit(). However, I get the following traceback:
>
>
> --------------- snip -------------------
>   File "copy_reg.py", line 69, in _reduce_ex
>     raise TypeError, "can't pickle %s objects" % base.__name__
> TypeError: can't pickle module objects
> ------------------ snip -------------------

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?

Best Regards,
Hermann

-- 
hermann at qwer.tk
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7


More information about the Zope-Dev mailing list