Hi,
> I simply tried the diffrerent options. And the reproducable result is:
> MULTI_THREADED=YES => deadlock
> MVCC=TRUE => no deadlock
>
> Maybe that's pure fortune that MVCC did not produce a deadlock up to now.
Maybe not.
On H2 MVCC introduce a big change in locking scheme from table to row level 
locks. This reduce very much the probability of a deadlocks (table scope to row 
scope).

Case 1: Record level collision (cross lock)

Th1:        lock  TA.r1
Th2:        lock  TB.r2
Th1:        lock  TB.r2
Th2:        lock  TA.r1
--------------------------> Deadlock on both cases

Case 2: Table level collision

Th1:        lock  TA.r1
Th2:        lock  TB.r2
Th1:        lock  TB.r3
Th2:        lock  TA.r4
--------------------------> Deadlock only if MVCC it's NOT used

Then MULTI_THREADED on or off , don't have any impact on this, but on H2 MVCC 
make a big difference.
On others dbms , row level locking is the default locking scheme and MVCC it's 
not an option, they are or not MVCC.

Indeed I had missed something ;-) sorry.

Regards,
Dario.

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to