[ZODB-Dev] conflict resolution for PersistentList
Chris McDonough
chrism at plope.com
Fri May 21 16:18:55 EDT 2004
On Fri, 2004-05-21 at 07:22, Diez B. Roggisch wrote:
> Hi,
>
> after finding that my ConflictError was suppressed by a bad designed exception
> handler,
AFAIK, it's a bug in whatever version of ZODB that you're using that you
are allowed to commit inconsistent state back to the database after
there has been a read conflict error, even one which is mistakenly
caught by your own exception handler. It just should raise a separate
conflict error at commit time, and even if *that* is mistakenly caught,
you shouldn't see inconsistent state in the database from a different
connection afterwards (the commit would have failed).
Which ZODB version are you using? Could you maybe post the relevant bit
of your code so I could try it out with the ZODB that ships with recent
versions of Zope to ensure that it's still not an existing bug?
> I now want to implement a _p_resolveConflict method.
>
> I implemented it, but can't work with the passed state. It looks like this:
>
> >>> print oldState
> {'items': PR(1079757676 ('\x00\x00\x00\x00\x00\x00\x00\x02', <class
> 'persistent.list.PersistentList'>)), 'name': 'father'}
I think you probably actually want conflict resolution on the persistent
list object itself instead of on its container. You can do this through
subclassing PersistentList.
More information about the ZODB-Dev
mailing list