[hibernate-dev] Change in DB lock acquisition in ORM?

Radim Vansa rvansa at redhat.com
Mon Nov 21 05:04:12 EST 2016


Hi,

I am investigating the failures in hibernate-infinispan testsuite and 
I've found that [1] is failing as this uses two threads that both do

1. load entity
2. delete entity
3. flush session
4. commit tx

on the same entity. There is a synchronization blocking the commit until 
both threads flush, and since the first thread holds a H2 DB lock on the 
entity, the other thread is blocked doing the flush on this lock.

It makes sense to me, but I wonder why did the test work in the past. 
Was there a change in some locking defaults (optimistic/pessimistic) or 
was there anything delegating the lock acquisition to the commit instead 
of flush? The test works on 5.0.10.

Radim

[1] 
https://github.com/hibernate/hibernate-orm/blob/master/hibernate-infinispan/src/test/java/org/hibernate/test/cache/infinispan/functional/TombstoneTest.java#L37


-- 
Radim Vansa <rvansa at redhat.com>
JBoss Performance Team



More information about the hibernate-dev mailing list