See my comment on the Jira. We can discuss this on IRC if you wish.
On Tue, Jun 9, 2015 at 6:51 AM andrea boriero <andrea(a)hibernate.org> wrote:
Hi Steve,
I'm getting crazy with
https://hibernate.atlassian.net/browse/HHH-9636
JPA pessimisticLockScope.EXTENDED
1. EntityManage#lock
1. LockMode.PESSIMISTIC_WRITE without extended lock scope adds a
"for update" just to the parent entity.
2. Setting the lock scope to Extended the lock is cascaded only if
the lock entity is detached because in
DefaultLockEventListener.onLock(LockEvent event) the cascadeOnLock(event,
persister, entity) is applyed only if EntityEntry entry =
source.getPersistenceContext().getEntry(entity) is null ,but anyway is not
applyed to Components like for the @ElementCollection in the issue
example. Not sure if this is the intended behavior.
2. Entitymanager#createQuery() and EntityManager#find()
with LockMode.PESSIMISTIC_WRITE and scope Extended add the "for update"
just to the parent entity.
Can you give me some help with this issue? Also a little explanation about
the intended behaviour of the PESSIMISTIC_WRITE and the scope is really
appreciated. The documentation is not so clear and i really want to
understand it.
Thanks
Andrea