[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6843) LockTest#testContendedPessimisticLock is too agressive in its assumptions

Hardy Ferentschik (JIRA) noreply at atlassian.com
Wed Nov 23 07:17:21 EST 2011


LockTest#testContendedPessimisticLock is too agressive in its assumptions
-------------------------------------------------------------------------

                 Key: HHH-6843
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6843
             Project: Hibernate Core
          Issue Type: Bug
          Components: annotations, testsuite
    Affects Versions: 4.0.0.CR6
            Reporter: Hardy Ferentschik
             Fix For: 4.0.0.next


The test assumes that if T1 gets a pessimistic write lock on some data without actually modifying it, a second transaction would actually block on a read of the same data. From a discussion w/ 

{quote}
emmanuel: If transaction T1 calls lock(entity, LockModeType.PESSIMISTIC_READ) or lock(entity, LockModeType.PESSIMISTIC_WRITE)on an object, the entity manager must ensure that neither of the following phenomena can occur:
[11:42am] emmanuel: - P1 (Dirty read): Transaction T1 modifies a row. Another transaction T2 then reads that row and obtains the modified value, before T1 has committed or rolled back.
[11:42am] emmanuel: - P2 (Non-repeatable read): Transaction T1 reads a row. Another transaction T2 then modifies or deletes that row, before T1 has committed or rolled back.
{quote}

Currently _testContendedPessimisticLock_ tests condition P1, but makes the assumptions that the data does not even have to be modified. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list