Standalone ZODB - Connections and multiple threads

David Bolen db3l at fitlinxx.com
Thu Nov 9 20:58:16 EST 2000


I'm wondering if someone here might be able to help out with a query
about using ZODB standalone without Zope?

ZODB3 is documented as supporting multiple connections to a storage
which supports independent object caches for multiple threads.
However, although I've looked around at a bunch of documents, I can't
seem to find if this is required or simply available.  That is, if I'm
using ZODB in a multi-threaded Python application, must I create
separate connections for each thread, or can they share a single
connection.

In my case, the application is already securing itself against
simultaneous access to the objects that I'm making persistent, so I
don't really think I need the distinct connections, but I ran into one
case where it seemed that the thread within which a
get_connection().commit() was performed was important to getting the
object changes really committed.

If I did create separate connections, my understanding is that the
object stores referenced beneath the root obtained from each
connection would be distinct in memory, but in my case the persistent
object information is truly being shared among the execution threads
(with appropriate locking), so I'd think having separate copies of
them would only complicate things.

Any information or pointers to information would be appreciated.
Thanks.

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list