[hibernate-dev] JPA2 locking

Emmanuel Bernard emmanuel at hibernate.org
Thu Oct 22 05:52:06 EDT 2009


On 20 oct. 09, at 20:22, Steve Ebersole wrote:

> On Tue, 2009-10-20 at 14:12 -0400, Scott Marlow wrote:
>> On 10/20/2009 12:16 PM, Steve Ebersole wrote:
>>> See my reading of P2 though is more than just ensuring a repeatable
>>> read.
>>>
>>> If T1 does lock(entity, LockModeType.PESSIMISTIC_READ) we need to  
>>> make
>>> sure T2 cannot update or delete that row b4 T1 completes.  That's
>>> blocking, not simply repeatable read.
>>>
>>
>> I guess we get into how repeatable read isolation level is  
>> implemented
>> and whether it could be implemented without at least a read lock on  
>> the
>> database table row.  Or did you mean something else?
> That's true.  And actually the dialects have a method to help with  
> this:
> Dialect#doesRepeatableReadCauseReadersToBlockWriters :)
>
> There is also, Dialect#doesReadCommittedCauseWritersToBlockReaders

Hum OK never mind my previous email :)



More information about the hibernate-dev mailing list