durusmail: quixote-users: ZODB FileStorage problem
ZODB FileStorage problem
2002-02-27
2002-02-28
2002-02-28
2002-03-01
DOMish view of HTML as it's being rendered
2002-02-28
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
2002-03-01
ZODB FileStorage problem
Greg Ward
2002-02-28
On 26 February 2002, David Ascher said:
> Anytime I try to use ZODB in Quixote, it seems that the FileStorage
> never gets closed.  For example:
>
>       storage = FileStorage.FileStorage('photodata.fs')
>       db = DB( storage )
>       conn = db.open()
>       dbroot = conn.root()
>
> in a .ptl script will create the photodata.fs, as well as the
> photodata.fs.lock, photodata.fs.tmp, and none of the files ever go away.

I'm not sure if the .lock and .tmp files are ever deleted -- but that's
a ZODB question.

Anyways, our main system has this:

  def _exitfunc (self):
      for db in ObjectDatabase._instances:
          db.close_database()

  atexit.register(_exitfunc, ())

where ObjectDatabase is a class that manages a connection to a ZODB
database; ObjectDatabase._instances is a class attribute that,
presumably, tracks existing ObjectDatabase instances.  So we don't ever
worry about explicitly closing our ZODB.

I can't speak for woolgather: Andrew?

        Greg
--
Greg Ward - software developer                gward@mems-exchange.org
MEMS Exchange                            http://www.mems-exchange.org


reply