[Zope-dev] volatile state maintenance
Sam Gendler
sgendler@silcom.com
Sun, 09 Apr 2000 02:53:30 -0700
I have a product which needs to maintain a connection to a 300MB
database file (Metakt, if you must know). The initial connection takees
about 3 seconds, due to the size of the file, so I wanted to make a
product that will keep the connection open, and re-use it.
I made a python base class which opens the connection, but I get the
following error from zope when it tries to pickle the object into the
ZODB.
Traceback (innermost last):
File /home/ultraseek/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py,
line 214, in publish_module
File /home/ultraseek/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py,
line 179, in publish
File /home/ultraseek/Zope-2.1.6-src/lib/python/Zope/__init__.py, line
202, in zpublisher_exception_hook
(Object: RoleManager)
File /home/ultraseek/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py,
line 169, in publish
File /home/ultraseek/Zope-2.1.6-src/lib/python/ZODB/Transaction.py,
line 237, in commit
File /home/ultraseek/Zope-2.1.6-src/lib/python/ZODB/Connection.py,
line 325, in commit
(Info: (('*yr88KIATmOLZfiZXPxWNeA==', 'ODP'),
'\000\000\000\000\000\000\000\262', ''))
UnpickleableError: (see above)
I don't actually need the database connection itself to be in the ZODB,
as it will not be open the next time zope restarts, anyway, but I would
like it to remain resident in memory so that I can use it without
reconnecting on every request. Additonally, it would be gat to be able
to detect when the connection has gone down, and re-create it.
Any tips? I am sure it can be done, but I have no idea where to even
start, as far as adding something to the global namespace
--sam