[ZODB-Dev] Removing "undeleteable" objects from ZODB

Shane Hathaway shane at hathawaymix.org
Mon Dec 19 18:29:36 UTC 2011


On 12/19/2011 02:50 AM, Eugene Morozov wrote:
> Is there some other way to remove them?

I would remove all references to the broken objects, then let packing 
wipe the old objects away. For example:

container = app['somefolder']
del container[obj_name]

It's possible to replace objects in the manner you posted, but it's 
usually a bad idea. If you really must do it, you have to set the 
_p_serial to the _p_serial of the existing object, which you can get 
using app._p_jar._storage._load(oid).

Shane


More information about the ZODB-Dev mailing list