Flavio Coelho wrote:
> The solution I am trying is to offload the db handling code to a
> separate module  that can be added to the import list of a PP job:
> dbserve.py
> Code:
> import ZODB
> import ZEO.ClientStorage
> class Data:
>     def __init__(self):
>         #setting up ZEO server
>         #os.system('runzeo -a localhost:8008 -f SN.fs &')
>         # setup database
>         storage = ZEO.ClientStorage.ClientStorage(('localhost',8008))
>         self.db = ZODB.DB(storage)
>     def getConn(self):
>         conn = self.db.open()
>         return conn.root()

Perhaps the import of ZEO.ClientStorage is quietly creating a thread.
AFAIK, PP doesn't work with threads created before forking.  If that is
the problem, you can work around it by importing ZEO.ClientStorage in
the __init__ method rather than at the top of the module.


For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to