[Zope] ZODB conflict error AFTER adding an 'Access Rules'
Dieter Maurer
dieter at handshake.de
Wed Sep 24 20:16:58 EDT 2003
Jean Baltus wrote at 2003-9-24 12:07 +0200:
> Thank you for your explanation Dieter. Do you have any clue why I'm
> having write conflicts when I add a call to the "change_skin" method in
> the "Access Rule" of our Plone site !!! ??? Even when we just browse the
> website, no update being made...
Often, write conflicts are caused by using a session.
Reading a session causes a write (to update the timeout mechanism).
> Is it possibly that it is a bug in CMF? In Zope? In the ZODB?
It is of course possible.
But I do not yet think it is likely, because I see few complaint
about conflict errors when using Zope/CMF.
E.g. we use it extensively and do not see this problem (and we use
AccessRules, too).
You can find out what the object with an oid is:
Read about how to inspect ZODB objects in an interactive
interpreter (you may need to add "PYTHONPATH" and stop Zope
(or use ZEO)).
In the interactive interpreter do:
from Zope import app
from ZODB.utils import p64
R= app() # the root object
c= R._p_jar # the main ZODB connection
o= c[p64(oid_as_hex)] # the object with oid "oid_as_hex"
print o
In your case: "o= c[p64(0x11)]"
This assumes, the conflict occured within the main ZODB.
Sessions use there own ZODB (and therefore a ZODB connection
different from that of the root) and store their session objects in RAM.
Therefore, it is not possible to inspect the session objects
in a separate process. You would need to use the Zope "monitor"
to inspect a running Zope itself. There is a HowTo (very old;
the monitor is nowadays no longer enabled by default) on Zope.org.
Inside the "monitor" client, you can use Python to inspect your
running Python as shown above. Inspecting session object with
oid "0x11" would look like:
from Zope import app
from ZODB.utils import p64
R= app() # the root object
tf= R.temp_folder # the temporary folder
c= tf._p_jar # the ZODB connection used by sessions
o= c[p64(oid_as_hex)] # the object with oid "oid_as_hex"
print o
> ...
> > js/share.js: database conflict error (oid 0000000000000011, serial
> was
> > 034fb0850
Dieter
More information about the Zope
mailing list