I have an issue in a Plone 6.1 site where something is trying to write to the ZODB during a GET request. The standard tool so far - dm.historical
- no longer works with Python 3.11+. Is there another decent way to detect unanticipated object writes?
I believe that you can add a breakpoint in a throw-away function you pass to transaction.get().addAfterCommitHook()
method, and from within that breakpoint you should be able to get OIDs modified via transaction.get()._resources[0]._modified
. You may (untested) be able to do something similar in some event notified by ZPublisher as well, but I am unsure where those happen re: when the connection is available.
plone.protect
has some code to prevent "write on read" during traversal. Its super magic to me, but maybe it helps you to find writes plone.protect/plone/protect/auto.py at master · plone/plone.protect · GitHub
1 Like