Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 324686

Summary: Three PessimisticLocking tests of jpa jpql model failed with assertion on GlassFish V3 only
Product: z_Archived Reporter: Yiping Zhao <yiping.zhao>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: christopher.delahunt, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
test fix none

Description Yiping Zhao CLA 2010-09-07 14:54:36 EDT
The test failures described in bug 301269 disappeared in eclipselink 2.1.x, so the bug 301269 has been closed, but the failures are occuring in 2.0.x branch, see detailed error messages in bug 301269 as https://bugs.eclipse.org/bugs/show_bug.cgi?id=301269

The failed tests are:

testQueryPESSIMISTIC_FORCE_INCREMENTLock
testVersionChangeWithReadLock
testVersionChangeWithWriteLock
Comment 1 Chris Delahunt CLA 2010-11-24 15:48:10 EST
Tests are failing in 2.0.3 due to a test case issue - they will only pass on an extended persistence context.  The tests in 2.1 and 2.2 have been corrected in revision 7250, but this was not applied to 2.0.x.

Simply, test was checking version numbers from a detached entity and expecting that a later transaction would result in it changed.  Outside the server, the extended persitence context meant the entity is still managed, and so the version does get correctly incremented on flushes.  

Simple test fix is to add
   employee = em.find(Employee.class, employee.getId());
before the assert so the test gets the correct value to use in the comparison.
Comment 2 Chris Delahunt CLA 2010-11-24 15:59:59 EST
Created attachment 183801 [details]
test fix

test case fix for these 3 tests.
Comment 3 Chris Delahunt CLA 2010-11-24 16:00:20 EST
Fix checked into 2.0.3 in revision 8559
Comment 4 Chris Delahunt CLA 2010-11-26 10:14:08 EST
*** Bug 320117 has been marked as a duplicate of this bug. ***
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:22:58 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink