On Sat, Oct 10, 2009 at 10:00 PM, Shane Hathaway <sh...@hathawaymix.org> wrote: > Hermann Himmelbauer wrote: >> That's exactly the problem - it's a read operation and there should not be >> any >> write operation involved. However, it's hard to find out where the write >> operation in my code occurs, I can't find it in the view, maybe there's >> something in the authentication code, but I'd have to dig deep through my >> source. So It would be extremely helpful to know a faster way to find out >> what code triggered this warning. > > The code that modifies something will indirectly call the register() > method of the ZODB.Connection class. If you arrange for > Connection.register() to raise an exception when the transaction is not > supposed to modify anything, you should get a traceback that pinpoints > what is doing the modification. Unfortunately, there is no API for > that, so the easiest thing to do is modify the source code of the > register() method in ZODB.Connection. Fortunately, this is Python, so > modifying someone else's code is usually quite easy. :-)
Easier yet, in a development environment, add a breakpoint in register and make a read-only request to see what's causing it to be called and why. Jim -- Jim Fulton _______________________________________________ Zope-Dev maillist - Zope-Dev@zope.org https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )