Guenther Demetz commented on Bug HHH-8161

Debugging the testcase I saw that LockModeType.WRITE is mapped to LockMode.OPTIMISTIC_FORCE_INCREMENT
which in Hiberante4 is being not executed immediately, but delayed to commit-time which is correct behavior.
I don't know how it was in Hiberante3, but it does not really matter since
you say, you need the lock being already active between lock() and remove().
This means that what you actually want is a PESSIMISTIC lock.
Under that point of view, forcing pessimistic lock (PESSIMISTIC_FORCE_INCREMENT) is'nt just a temporary solution, it's the solution par excellence.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira