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

Eugene Morozov eugene.morozov at gmail.com
Mon Dec 19 09:50:39 UTC 2011


Hello,
I have a very old Zope instance (it was upgraded from Zope 2.4 to Zope 2.7
and later to Zope 2.13) that has a number of problems. There're instances
of products that no longer exist, for example. They can't be removed by
using any means. They can't be removed from Zope user interface (some of
them aren't even visible). They can't be removed from python prompt as
described in this document:
http://zodb.org/documentation/articles/multi-zodb-gc.html

The simplest script to replace broken object with some pristine object
doesn't work:
replace_obj = OrderedFolder('removeme')
replace_obj._p_oid = p64(BROKEN_OBJECT_ID)
replace_obj._p_jar = app._p_jar
app._p_jar._register(replace_obj)
app._p_jar._added[p64(BROKEN_OBJECT_ID)] = replace_obj

This code always fails because with the following exception:
ConflictError: database conflict error (oid 0x0db8, class
OFS.OrderedFolder.OrderedFolder, serial this txn started with 0x00
1900-01-01 00:00:00.000000, serial currently committed 0x03384864da015019
2000-11-05 00:36:51.094952)

As far as I understand ConflictError is raised because transaction code
always attempts to read broken object and compare it with the new object. I
couldn't find any working way to remove such broken objects from the
database and they often get in the way. :(

Is there some other way to remove them?
Eugene
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/zodb-dev/attachments/20111219/3ca489e9/attachment.html>


More information about the ZODB-Dev mailing list