[Zope-Coders] Persistent Sessions question

Shane Hathaway shane@zope.com
Tue, 15 Oct 2002 14:04:36 -0400


Evan Simpson wrote:
> Shane Hathaway wrote:
> 
>> Funny you should ask.  I've just created a product for a customer 
>> called DBTab.  It lets you mount databases (including ZEO) using a 
>> simple configuration file, similar to /etc/fstab.  Works great so far.
> 
> 
> By this, do you mean a file containing a list of storage description and 
> mount point entries?  Do they all auto-mount, or do you provide a ZMI 
> control interface?  I'd love to see it.

Yes.  Most of the configuration is in the file, but actually creating 
the configured mount points is done in the ZMI (to avoid accidentally 
stomping on ZODB data.)  I just added it to cvs.zope.org:

http://cvs.zope.org/Products/DBTab/

Remember, the config file format is likely to change soon, so don't go 
writing GUIs for it yet. :-)

> Congratulations on Tanner's birth, by the way!

Thanks!

>> It should work, although there's a bug in ZODB/Mount.py: long-running 
>> transactions that work on lots of ZODB objects can exhaust all the 
>> available mounted connections
> 
> 
> Does the "lots of ZODB objects" apply only to the mounted storage, or is 
> there danger in long-running transactions that work on many objects in 
> the main storage, but only read or twiddle a few objects in the mounted 
> storage?

The scenario you describe is likely to provoke the bug.  You see, if the 
mount point object gets ghostified during a subtransaction commit, it 
forgets the reference it had to the open mounted connection.  When the 
ghost is brought back, it makes a new connection.  We get around the 
multiple connections problem by making the main connection close all 
mounted connections, but if it happens too many times in a transaction 
then you'll run out of mounted connections and deadlock.

But again, DBTab fixes this properly.  Check it out.  I'll release a 
tarball soon.

Shane