[ZODB-Dev] __del__ with Persistent objects

Stuart Bishop zen at shangri-la.dropbear.id.au
Fri Jul 18 18:24:18 EDT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Friday, July 18, 2003, at 01:42  AM, Toby Dickenson wrote:

> Do the filesystem-based things know the oid or path of the thing that 
> created
> them? if yes, you could create some external garbage collection 
> process.

Ahh... OIDs... thats a good idea. If instead of my factory object
storing a reference to the FileRef object, I store the object id, then
I should be able to detect when that FileRef is no longer in the
database. _p_jar[oid] still works after an object is deleted
from the ZODB, but throws a KeyError when the transaction has been
packed away which seems to be exactly the behaviour I'm after.
I have an implementation that appears to work and pass my unit tests.

> There is an alternative approach that Im sure you have considered.... 
> store
> these things direct in the ZODB, and forget the filesystem.

FileStorage is out, but DirectoryStorage may be an option (assuming it
handles multiple references to the same object happily). Directory
Storage will probably be the way we go.

- -- 
Stuart Bishop <zen at shangri-la.dropbear.id.au>
http://shangri-la.dropbear.id.au/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)

iD8DBQE/F6Coh8iUz1x5geARAmL5AKDl+w4iwCIeq/lD45wX9dhGp31FYACgryiT
qZEL033uuY3v4SL35KG70OY=
=FaFH
-----END PGP SIGNATURE-----




More information about the ZODB-Dev mailing list