jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominik Klaholt <do...@mail.upb.de>
Subject Locks and Transactions - JCR spec example
Date Thu, 30 Sep 2010 17:16:24 GMT
Hello,

has anyone else stumbled across the JCR spec example on how to avoid 
lost updates (page 240):

begin
     lock
commit

begin
     do A
     save
     do B
     save
     unlock
commit

The strange thing about this example is that the unlock does not have an 
effect if the transaction rolls back - so whatever is locked stays locked.
Is there any way to ensure that the unlock happens no matter whether the 
transaction commits or rolls back (or is the example just a little 
confusing)?

Thanks
Dominik

Mime
View raw message