Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 326461 - Some pessimistic locking tests of the JPA LRG test suite block on MaxDB
Summary: Some pessimistic locking tests of the JPA LRG test suite block on MaxDB
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard: test mysql
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-28 16:43 EDT by Adrian Goerler CLA
Modified: 2022-06-09 10:25 EDT (History)
5 users (show)

See Also:


Attachments
patch rewriting tests to avoid deadlock on MaxDB; fixing issue with pessimistic lock scope EXTENDED on MySQL (35.94 KB, patch)
2010-09-29 04:30 EDT, Adrian Goerler CLA
no flags Details | Diff
patch rewriting tests to avoid deadlock on MaxDB; fixing issue with pessimistic lock scope EXTENDED on MySQL (36.05 KB, patch)
2010-09-29 06:36 EDT, Adrian Goerler CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Goerler CLA 2010-09-28 16:43:29 EDT
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.
Comment 1 Adrian Goerler CLA 2010-09-29 04:30:40 EDT
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)
Comment 2 Adrian Goerler CLA 2010-09-29 06:36:56 EDT
Created attachment 179824 [details]
patch rewriting tests to avoid deadlock on MaxDB; fixing issue with pessimistic lock scope EXTENDED on MySQL

improved thread synchronization
Comment 3 Adrian Goerler CLA 2010-10-01 04:40:06 EDT
Reviewed by Yiping and Gordon
Tested on Oracle, MySQL, MaxDB
Checked in at #8276
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:16:29 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:25:21 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink