Bug 262256 - jpa.xml.relationships.EntityMappingsRelationshipsJUnitTestCase.testDeleteCustomer failed on all application server
Summary: jpa.xml.relationships.EntityMappingsRelationshipsJUnitTestCase.testDeleteCust...
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: test
Depends on:
Blocks:
 
Reported: 2009-01-23 17:48 EST by Kevin Yuan CLA
Modified: 2022-06-09 10:34 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Yuan CLA 2009-01-23 17:48:41 EST
This test case failed on WLS/OC4J/WAS/JBoss/Glassfish, the following Exception are running on WAS 6.1:

<error message="javax.transaction.RollbackException" type="java.lang.RuntimeException">java.lang.RuntimeException: javax.transaction.RollbackException
	at org.eclipse.persistence.testing.framework.server.JEEPlatform.commitTransaction(JEEPlatform.java:76)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.commitTransaction(JUnitTestCase.java:209)
	at org.eclipse.persistence.testing.tests.jpa.xml.relationships.EntityMappingsRelationshipsJUnitTestCase.testDeleteCustomer(EntityMappingsRelationshipsJUnitTestCase.java:184)
	at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:391)
	at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
	at org.eclipse.persistence.testing.framework.server.EJSRemote0SLTestRunner_ed643271.runTest(EJSRemote0SLTestRunner_ed643271.java)
	at org.eclipse.persistence.testing.framework.server._EJSRemote0SLTestRunner_ed643271_Tie.runTest(_EJSRemote0SLTestRunner_ed643271_Tie.java)
	at org.eclipse.persistence.testing.framework.server._EJSRemote0SLTestRunner_ed643271_Tie._invoke(_EJSRemote0SLTestRunner_ed643271_Tie.java)
	at com.ibm.CORBA.iiop.ServerDelegate.dispatchInvokeHandler(ServerDelegate.java:621)
	at com.ibm.CORBA.iiop.ServerDelegate.dispatch(ServerDelegate.java:474)
	at com.ibm.rmi.iiop.ORB.process(ORB.java:503)
	at com.ibm.CORBA.iiop.ORB.process(ORB.java:1571)
	at com.ibm.rmi.iiop.Connection.respondTo(Connection.java:2701)
	at com.ibm.rmi.iiop.Connection.doWork(Connection.java:2575)
	at com.ibm.rmi.iiop.WorkUnitImpl.doWork(WorkUnitImpl.java:62)
	at com.ibm.ejs.oa.pool.PooledThread.run(ThreadPool.java:118)
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
Caused by: javax.transaction.RollbackException
	at com.ibm.ws.Transaction.JTA.TransactionImpl.stage3CommitProcessing(TransactionImpl.java:1846)
	at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1621)
	at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1543)
	at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:240)
	at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:164)
	at com.ibm.ws.Transaction.JTA.UserTransactionImpl.commit(UserTransactionImpl.java:292)
	at com.ibm.ejs.container.UserTransactionWrapper.commit(UserTransactionWrapper.java:303)
	at org.eclipse.persistence.testing.framework.server.JEEPlatform.commitTransaction(JEEPlatform.java:74)
	... 22 more
Caused by: javax.persistence.OptimisticLockException: Exception [EclipseLink-5003] (Eclipse Persistence Services - 1.1.0 (Build 20081217)): org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object [org.eclipse.persistence.testing.models.jpa.xml.relationships.Order@65646564] cannot be deleted because it has changed or been deleted since it was last read. 
Class&gt; org.eclipse.persistence.testing.models.jpa.xml.relationships.Order Primary Key&gt; [1]
	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.commitToDatabase(RepeatableWriteUnitOfWork.java:443)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.commitToDatabaseWithChangeSet(UnitOfWorkImpl.java:1362)
	at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.issueSQLbeforeCompletion(UnitOfWorkImpl.java:2915)
	at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.issueSQLbeforeCompletion(RepeatableWriteUnitOfWork.java:216)
	at org.eclipse.persistence.transaction.AbstractSynchronizationListener.beforeCompletion(AbstractSynchronizationListener.java:157)
	at org.eclipse.persistence.transaction.JTASynchronizationListener.beforeCompletion(JTASynchronizationListener.java:68)
	at com.ibm.ws.Transaction.JTA.RegisteredSyncs.distributeBefore(RegisteredSyncs.java:242)
	at com.ibm.ws.Transaction.JTA.TransactionImpl.prePrepare(TransactionImpl.java:2404)
	at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1637)
	at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1608)
	... 28 more
Comment 1 Kevin Yuan CLA 2009-08-07 17:12:16 EDT
Since Order and Customer is one-to-many relationship, and when delete order are cascade-all, so inside container, should refresh the state of the instance from the database, overwriting changes made to the order before delete customer.
Change suggested by James Sutherland.
Test by run JPA-LRG and server test.

Checked in 2.0 - Revision: 4816
Backport to 1.1 branch - Revision: 4817
Comment 2 Peter Krogh CLA 2009-08-26 09:46:21 EDT
Mass update to change fixed in target.
Comment 3 Peter Krogh CLA 2009-08-26 09:48:43 EDT
Mass update to change fixed in target.
Comment 4 Peter Krogh CLA 2009-08-26 09:53:38 EDT
Mass update to change fixed in target.
Comment 5 Peter Krogh CLA 2009-08-26 09:55:58 EDT
Mass update to change fixed in target.
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:34:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink