Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 248489 - JPA 2.0 Pessimistic Locking/Lock Mode support
Summary: JPA 2.0 Pessimistic Locking/Lock Mode support
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 250442 274431 (view as bug list)
Depends on:
Blocks: 248291
  Show dependency tree
 
Reported: 2008-09-24 15:07 EDT by Gordon Yorke CLA
Modified: 2022-06-09 10:21 EDT (History)
6 users (show)

See Also:


Attachments
Proposed updates (100.17 KB, patch)
2008-10-10 14:49 EDT, Guy Pelletier CLA
no flags Details | Diff
Updated changes (102.18 KB, patch)
2008-10-15 15:48 EDT, Guy Pelletier CLA
no flags Details | Diff
Updated patch (102.19 KB, patch)
2008-10-16 13:59 EDT, Guy Pelletier CLA
no flags Details | Diff
Updated patch (49.13 KB, patch)
2008-10-23 16:04 EDT, Guy Pelletier CLA
no flags Details | Diff
Updated patch with testing additions (58.75 KB, patch)
2008-10-24 11:57 EDT, Guy Pelletier CLA
no flags Details | Diff
New patch with a number of changes. (80.75 KB, patch)
2008-10-28 14:20 EDT, Guy Pelletier CLA
no flags Details | Diff
Code changes (23.45 KB, patch)
2008-12-17 11:26 EST, Guy Pelletier CLA
no flags Details | Diff
Update patch (4.64 KB, patch)
2008-12-23 11:08 EST, Guy Pelletier CLA
no flags Details | Diff
Update patch (40.06 KB, patch)
2009-05-06 13:21 EDT, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gordon Yorke CLA 2008-09-24 15:07:53 EDT
This bug covers implementing support for Pessimistic locking support.
See http://wiki.eclipse.org/index.php?title=EclipseLink/Development/JPA_2.0/pessimistic_locking for details
Comment 1 Gordon Yorke CLA 2008-09-24 16:10:57 EDT
Updates have also been made to the names of the Optimistic Locking lock modes which should be supported within this bug.
Comment 2 Guy Pelletier CLA 2008-10-10 10:34:30 EDT
*** Bug 250442 has been marked as a duplicate of this bug. ***
Comment 3 Guy Pelletier CLA 2008-10-10 14:49:18 EDT
Created attachment 114828 [details]
Proposed updates
Comment 4 Guy Pelletier CLA 2008-10-15 15:48:24 EDT
Created attachment 115185 [details]
Updated changes

Updates to the wiki describing the enhancement coming soon ...
Comment 5 Guy Pelletier CLA 2008-10-16 13:59:05 EDT
Created attachment 115287 [details]
Updated patch

Documentation has been updated as well on the wiki.
Comment 6 Guy Pelletier CLA 2008-10-16 16:55:03 EDT
Patch has been submitted.

Reviewed by: Gordon Yorke

New tests:

EntityManagerJUnitTestSuite
 - testWRITELock
 - testOPTIMISTIC_FORCE_INCREMENTLock
 - testOPTIMISTICLock
 - testPESSIMISTICLock
 - testPESSIMISTIC_FORCE_INCREMENTLock
 - testPESSIMISTIC_TIMEOUTLock
 - testRefreshOPTIMISTICLock
 - testRefreshPESSIMISTICLock

AdvancedQueryTestSuite
 - testQueryREADLock
 - testQueryWRITELock
 - testQueryOPTIMISTICLock
 - testQueryOPTIMISTIC_FORCE_INCREMENTLock
 - testQueryPESSIMISTICLock ) 
 - testQueryPESSIMISTIC_FORCE_INCREMENTLock
 - testQueryPESSIMISTICTIMEOUTLock
Comment 7 Guy Pelletier CLA 2008-10-21 10:59:52 EDT
re-opening to the bug to re-visit/incorporate some changes and suggestions from James.
Comment 8 Guy Pelletier CLA 2008-10-23 16:04:50 EDT
Created attachment 115982 [details]
Updated patch
Comment 9 Guy Pelletier CLA 2008-10-24 11:57:22 EDT
Created attachment 116064 [details]
Updated patch with testing additions
Comment 10 Guy Pelletier CLA 2008-10-28 14:20:58 EDT
Created attachment 116332 [details]
New patch with a number of changes.
Comment 11 Guy Pelletier CLA 2008-10-29 11:50:07 EDT
Patch has been submitted.

Reviewed by: Gordon Yorke, James Sutherland

New tests:

AdvancedJPAJunitTest 
 - testPessimisticLockingNamedQuery

EntityManagerJUnitTestSuite
 - testLockingLeftJoinOneToOneQuery
 - testLockingLeftJoinOneToOneQuery2
Comment 12 Guy Pelletier CLA 2008-12-17 11:24:14 EST
Re-opening the bug to submit final changes to remove JPA 2.0 dependencies on core.
Comment 13 Guy Pelletier CLA 2008-12-17 11:26:09 EST
Created attachment 120717 [details]
Code changes

Remove JPA 2.0 dependencies on core
Comment 14 Guy Pelletier CLA 2008-12-17 13:59:16 EST
Changes submitted.

No new functionality changes, simply removing the JPA 2.0 dependencies on internal core classes.

Reviewed by: Gordon Yorke
Comment 15 Guy Pelletier CLA 2008-12-23 11:04:51 EST
Re-opening to add another patch
Comment 16 Guy Pelletier CLA 2008-12-23 11:08:15 EST
Created attachment 121154 [details]
Update patch
Comment 17 Guy Pelletier CLA 2008-12-23 12:57:00 EST
Updated patch submitted.

New JPA 2.0 test added: testPESSIMISTICLockWithNoChanges (commented out for check-in though pending JPA 2.0 test building changes)

Reviewed by: Gordon Yorke
Comment 18 Gordon Yorke CLA 2009-04-01 14:21:56 EDT
There are some issues with our MYSQL platform that should be resolved prior to closing this bug.
Comment 19 Gordon Yorke CLA 2009-04-01 15:25:07 EDT
Should be fixed.  Wait statements are not supported in MYSQL.
Comment 20 Doug Clarke CLA 2009-04-02 13:18:45 EDT
The JPA 2.0 Public Final Draft has changed the names of the enum values on LockModeType. They are now:

public enum LockModeType
{
READ,
WRITE,
OPTIMISTIC,
OPTIMISTIC_FORCE_INCREMENT,
PESSIMISTIC_READ,
PESSIMISTIC_WRITE,
PESSIMISTIC_FORCE_INCREMENT,
NONE
}

Things I believe we need to address:

1. There are various places in the ObjectLevelReadQuery that have the previous name values that need to be updated.

2. I understand the additional statics were added to avoid coupling with the JPA 2.0 version of LockModeType while shipping a JPA 1.0 implementation. If we need to keep these I believe its a better solution to set these up on a separate class. Multiple 'sets' of enum type statics on the same class makes code completion to use these less usable. 

3. The Eclipse header for the ObjectLevelReadQuery should include a description of the additional functionality added with the bug #.
Comment 21 Doug Clarke CLA 2009-04-02 15:27:49 EDT
We should probably also capture in the javaDoc comments of QueryHints.PESSIMISTIC_LOCK and org.eclipse.persistence.config.PessimisticLock that as of JPA 2.0 there is a standard way to configure pessimistic locking and reference the new way using @see/@link refs.
Comment 22 Doug Clarke CLA 2009-04-05 11:10:54 EDT
Changed target from 1.1 to 2.0
Comment 23 Doug Clarke CLA 2009-04-08 15:09:35 EDT
Changing priority to P@ since JPA 2.0 features are required for the 2.0 release
Comment 24 Guy Pelletier CLA 2009-05-06 10:11:45 EDT
*** Bug 274431 has been marked as a duplicate of this bug. ***
Comment 25 Guy Pelletier CLA 2009-05-06 13:21:24 EDT
Created attachment 134652 [details]
Update patch

Patch to support the spec changes of LockModeType.
Comment 26 Guy Pelletier CLA 2009-05-07 10:02:19 EDT
Patch submitted

Reviewed by: Gordon Yorke

Existing tests uncommented from the testing framework and new ones added to test the new lock mode types (PESSIMISTIC_READ and PESSIMISTIC_WRITE, spun from original PESSIMISTIC tests):

EntityManagerJUnitTestSuite
 - testWRITELock
 - testOPTIMISTIC_FORCE_INCREMENTLock
 - testOPTIMISTICLock
 - testPESSIMISTIC_READLock
 - testPESSIMISTIC_WRITELock
 - testPESSIMISTIC_FORCE_INCREMENTLock
 - testPESSIMISTIC_READ_TIMEOUTLock
 - testPESSIMISTIC_WRITE_TIMEOUTLock
 - testRefreshOPTIMISTICLock
 - testRefreshPESSIMISTIC_READLock
 - testRefreshPESSIMISTIC_WRITELock

AdvancedQueryTestSuite
 - testQueryREADLock
 - testQueryWRITELock
 - testQueryOPTIMISTICLock
 - testQueryOPTIMISTIC_FORCE_INCREMENTLock
 - testQueryPESSIMISTIC_READLock
 - testQueryPESSIMISTIC_WRITELock
 - testQueryPESSIMISTIC_FORCE_INCREMENTLock
 - testQueryPESSIMISTIC_READ_TIMEOUTLock
 - testQueryPESSIMISTIC_WRITE_TIMEOUTLock
Comment 27 Peter Krogh CLA 2009-08-26 09:44:36 EDT
Mass update to change fixed in target.
Comment 28 Peter Krogh CLA 2009-08-26 09:46:55 EDT
Mass update to change fixed in target.
Comment 29 Peter Krogh CLA 2009-08-26 09:50:45 EDT
Mass update to change fixed in target.
Comment 30 Peter Krogh CLA 2009-08-26 09:52:59 EDT
Mass update to change fixed in target.
Comment 31 Eclipse Webmaster CLA 2022-06-09 10:21:21 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink