Skip to content

Instantly share code, notes, and snippets.

@kcleong
Last active May 6, 2024 12:34
Show Gist options
  • Save kcleong/ab800d4cd9778f8c7a84772c7b0b9f4b to your computer and use it in GitHub Desktop.
Save kcleong/ab800d4cd9778f8c7a84772c7b0b9f4b to your computer and use it in GitHub Desktop.
from ZODB.utils import p64
# Replace with OIDs from: https://gist.github.com/kcleong/b12a5aaaf3df5df0fee737457eeda5a0
oids= []
for oid in oids:
oid = p64(oid)
try:
pickle, state = app._p_jar.db()._storage.load(oid)
except:
continue
from ZODB.Connection import TransactionMetaData
txn = TransactionMetaData()
app._p_jar.db()._storage.tpc_begin(txn)
app._p_jar.db()._storage.deleteObject(oid, state, txn)
app._p_jar.db()._storage.tpc_vote(txn)
app._p_jar.db()._storage.tpc_finish(txn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment