Community
Participate
Working Groups
The JPA testsuite is excuted with isolation level READ COMMITED. On MAxDB, pessimistic locking with the semantics of LockModeType.PESSIMISTC_WRITE is achieved by using an EXLUSIVE lock, which blocks readers in READ COMMITED. Moreover, the lock timeout cannot be configured dynamically on MaxDB but is a database parameter, which is possibly very long. Some pessimistic lock tests rely on that either - concurrent reads are not blocked (such as on Oracle) or - a lock is released quickly if a short lock timeout is specified Neither is the case on MaxDB. Hence the tests need to be altered.
Created attachment 179814 [details] patch rewriting tests to avoid deadlock on MaxDB; fixing issue with pessimistic lock scope EXTENDED on MySQL PessimisticLockingExtendedScopeTestSuite: Test are rewritten so that they assert REPEATABLE READ semantics in the presence of a WRITE LOCK. MySQLPlatfrom: Rewriting PessimisticLockingExtendedScopeTestSuite indicated that locks with pessimistic lock scope EXTENDED did not lock dependent tables on MySQL. A fix is provided in this patch. AdvancedQueryTestSuite: The statements are reordered to avoid a deadlock upon reading a locked entity. Tested on - MaxDB -> some failures but tests are not hanging - Oracle -> OK - MySQL -> (but see 326424)
Created attachment 179824 [details] patch rewriting tests to avoid deadlock on MaxDB; fixing issue with pessimistic lock scope EXTENDED on MySQL improved thread synchronization
Reviewed by Yiping and Gordon Tested on Oracle, MySQL, MaxDB Checked in at #8276
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink