Last active
May 6, 2024 12:34
-
-
Save kcleong/ab800d4cd9778f8c7a84772c7b0b9f4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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