[ZODB-Dev] Sequences and ZODB conflicts

Christian Reis kiko@async.com.br
Wed, 29 Jan 2003 08:57:18 -0200


On Wed, Jan 29, 2003 at 10:15:29AM +0000, Toby Dickenson wrote:
> On Wednesday 29 January 2003 1:27 am, Christian Reis wrote:
> 
> > Have I lost the chance to save this instance forever
> 
> Yes. You should repeat the transaction from the beginning.

Could I also use _p_resolveConflict to try and fix this situation?

One thing I wonder about it, though, is in which object it will be
actually be called. I need to bore through the code but as I understand
it each conflicting object will call that hook. So it would only be
called for the Sequence object - and from there I would need to update
the domain object to use the new value.

> > All that conflicted was the Sequence, after all.
> 
> You could split it into two transactions. The first increments the sequence 
> number, the second uses it.

That's an idea I had, but it's not the nicest solution; there may not be
a nicer one though (without support for more finer-grained conflicts).

> Of course this raises a risk that a failure between the two transactions might 
> cause a number to be lost. I think there might be a way around this using 
> versions....

It's what I thought, too. But it seems nobody knows how to use ZODB
versions! <wink>

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL