Hi all, Worker threads in one of my programs get a hook into the ZODB as follows: zopeRootOb = ZODB.ZApplication.ZApplicationWrapper(DB, 'Application', OFS.Application.Application, (), Globals.VersionNameName)() ( I think the following does the same, but haven't tried it: zopeRootOb = Zope.app() ) I get a problem where the above call will block indefinately. After poking around I found that the blocking happens when len(DB._pools[1][0][1]) goes to zero. Obviously I have used up all the connections into the ZODB causing the lockup. Is there a way to ensure the "release" of my connection once I am finished, or will this happen automatically when zopeRootOb's reference count goes to zero (i.e. the function goes out of scope and it gets auto dereferenced)? I am thinking of waiting for len(DB._pools[1][0][1]) to go higher than zero before trying to get a connection, but somehow this feels like hacking. Is there an elegant way to wait for a connection to become available? Thanks Etienne
You can to close the ZODB connection with a call to zopeRootObj._p_jar.close() Stefan --On Donnerstag, 20. Februar 2003 18:48 +0200 Etienne Labuschagne <elabuschagne@gmsonline.co.za> wrote:
Is there a way to ensure the "release" of my connection once I am finished, or will this happen automatically when zopeRootOb's reference count goes to zero (i.e. the function goes out of scope and it gets auto dereferenced)?
-- Those who write software only for pay should go hurt some other field. /Erik Naggum/
Etienne Labuschagne wrote at 2003-2-20 18:48 +0200:
Worker threads in one of my programs get a hook into the ZODB as follows:
zopeRootOb = ZODB.ZApplication.ZApplicationWrapper(DB, 'Application', OFS.Application.Application, (), Globals.VersionNameName)()
( I think the following does the same, but haven't tried it: zopeRootOb = Zope.app() )
I get a problem where the above call will block indefinately.
After poking around I found that the blocking happens when len(DB._pools[1][0][1]) goes to zero.
You need to close the connection when you no longer need it: zopeRootOb._p_jar.close() The "_p_jar" is the connection (unless it is "None", in which case the object is not (yet) persistent). Dieter
participants (3)
-
Dieter Maurer -
Etienne Labuschagne -
Stefan H. Holek