[ZODB-Dev] Re: Concurrent transactions

Dieter Maurer dieter at handshake.de
Fri Jun 1 14:26:57 EDT 2007


Kai Diefenbach wrote at 2007-6-1 10:31 +0200:
> ...
>Christian Theune <ct at gocept.com> wrote:
>> Am Freitag, den 01.06.2007, 09:47 +0200 schrieb Kai Diefenbach:
>> > A gets counter = 5
>> > B gets counter (before A writes the increased counter) = 5
>> > 
>> > A increases and writes the counter => 6 
>> > B increases and writes the counter => 6 (*)
>> > 
>> > *) In my understanding, here a ConflictError is raised and the whole
>> > transaction will be repeated, that means it starts with the counter of
>> > 6. Is this right?
>> ...
>> And you can make it perform better by implementing application level
>> conflict resolution so your counter knows that if two transactions moved
>> from 5 to 6 concurrently the real value should be 7. This is *the*
>> example for when application level conflict resolution is helpful.

Using application level conflict resolution can be dangerous:

  It would e.g. if the counter value were used in the download.

If the application can accept the behaviour (two non-conflicting transactions
see the same counter value), then "BTrees.Length.Length" has
this conflict resolution. No need to invent something of your own.



-- 
Dieter


More information about the ZODB-Dev mailing list