[Zope] ZODB: Are all handles closed?

Ulla Theiss u.theiss@eurodata.de
Fri, 07 Mar 2003 13:32:35 +0100


Hello list,

in our product (and additionally in an other process) we use separate
ZODB-Storages.

Opening and closing the ZODB several times the number of file-handles
increases.

We have separated the multiple openings and closings to the following
code.
It shows the increasing of the handles clearly.

Have we forgotten to clear anything or made anything wrong? 
If not, has anybody an idea, how to fix or work around the problem.

----------------------------------snip------snap---------------------
from ZODB import FileStorage, DB

for i in range (1,100):
    storage=FileStorage.FileStorage("TestZODB.fs")
    db = DB(storage)
    db.open()
    print "Open"
    db.close()
    print "Close"
    storage.close()
----------------------------------snip------snap---------------------

Enother nice behaviour we can achieve with the following code:

----------------------------------snip------snap---------------------
from ZODB import FileStorage, DB

storage=FileStorage.FileStorage("TestZODB.fs")
db = DB(storage)

for i in range (1,100):
    db.open()
    print "Open"
    db.close()
    print "Close"
    storage.close()
----------------------------------snip------snap---------------------

It works about seven times. Then the programm hangs completely.

Much thanks in advance,
Ulla.