Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 347489 - LockOnCloneDeadlockAvoidanceTest failed on JDK 1.7
Summary: LockOnCloneDeadlockAvoidanceTest failed on JDK 1.7
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:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-27 13:40 EDT by Edwin Tang CLA
Modified: 2022-06-09 10:23 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix (1.03 KB, patch)
2011-06-01 14:37 EDT, David Minsky CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edwin Tang CLA 2011-05-27 13:40:17 EDT
With 2.3.0.v20110518-r9407, org.eclipse.persistence.testing.tests.unitofwork.LockOnCloneDeadlockAvoidanceTest in UnitOfWorkIsolatedAlwaysTestModel failed on JDK 1.7(build 1.7.0-ea-b139), it threw NPE during resetting.

This is an regression. The test passed with 2.3.0.v20110516-r9382.

Stack Trace:
============
Exception Description: Problem in the reset method of the test Internal Exception: java.lang.NullPointerException

Local Exception Stack:
Exception [EclipseLink-0] (Eclipse Persistence Services - 2.3.0.v20110518-r9407): org.eclipse.persistence.testing.framework.TestProblemException
Exception Description: Problem in the reset method of the test
Internal Exception: java.lang.NullPointerException
at org.eclipse.persistence.testing.framework.TestCase.execute(TestCase.java:183)
at org.eclipse.persistence.testing.framework.TestCase.runBare(TestCase.java:265)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:248)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
at org.eclipse.persistence.testing.framework.TestExecutor.execute(TestExecutor.java:248)
at org.eclipse.persistence.testing.framework.TestModel.execute(TestModel.java:208)
at org.eclipse.persistence.testing.framework.TestCollection.run(TestCollection.java:313)
Caused by: java.lang.NullPointerException
at java.util.TreeMap.compare(TreeMap.java:1188)
at java.util.TreeMap.put(TreeMap.java:531)
at org.eclipse.persistence.internal.sessions.CommitManager.sort(CommitManager.java:351)
at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(CommitManager.java:312)
at org.eclipse.persistence.internal.sessions.CommitManager.deleteAllObjects(CommitManager.java:283)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabase(UnitOfWorkImpl.java:1410)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1493)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitRootUnitOfWork(UnitOfWorkImpl.java:1317)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commit(UnitOfWorkImpl.java:1079)
at org.eclipse.persistence.testing.tests.unitofwork.LockOnCloneDeadlockAvoidanceTest.reset(LockOnCloneDeadlockAvoidanceTest.java:82)
at org.eclipse.persistence.testing.framework.TestCase.tearDown(TestCase.java:244)
at org.eclipse.persistence.testing.framework.TestCase.execute(TestCase.java:174)
Comment 1 Edwin Tang CLA 2011-05-31 12:57:29 EDT
The regression is related to David Minsky's check-in(for bug 331164) on revision 9403.
Comment 2 David Minsky CLA 2011-06-01 14:24:26 EDT
Discussed with Gordon:

LockOnCloneDeadlockAvoidanceTest fails on JDK1.7, but not on JDK1.6 as the JDK1.7 TreeMap throws an NPE when put(Object, Object) is invoked with null, (ConcurrentPerson instance) respectively.

Upon further inspection, the cached 'person' attribute in LockOnCloneDeadlockAvoidanceTest has a null primary key, and the JDK1.7 failure is exposing this testing problem.

To resolve this, we should instead cache the object returned from the uow registration call.
Comment 3 David Minsky CLA 2011-06-01 14:37:22 EDT
Created attachment 197137 [details]
Proposed fix
Comment 4 David Minsky CLA 2011-06-01 16:14:31 EDT
Fixed in 2.3 revision: 9495
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:23:33 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink