[Zope3-Users] ConnectionStateError when a worker thread finishes

Stephan Richter srichter at cosmos.phy.tufts.edu
Mon Jan 8 03:50:34 EST 2007


On Wednesday 03 January 2007 05:46, Shailesh Kumar wrote:
> In my application, some background threads are being created. But when a
> thread finishes up its work, a strange exception is thrown:
> The callstack doesn't show any part of my application code.

You have to use threads very carefully, if they modify the database. The 
correct way is to create a new connection to the ZODB do your work, commit 
the transaction and close the connection. Pretty much copy what the publisher 
does. Another alternative is to create a new publisher request of course.

Regards,
Stephan
-- 
Stephan Richter
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training


More information about the Zope3-users mailing list