Community
Participate
Working Groups
When trying to run jpa.delimited.DelimitedPUTestSuite on WebLogic server, the "testPopulate" failed during em.refresh(pn)with the following exception (but all other three tests passed on WLS): <testcase classname="org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite" name="testPopulate" time="2.64"> <error message="The method public abstract void javax.persistence.EntityManager.refresh(java.lang.Object) must be called in the context of a transaction." type="javax.persistence.TransactionRequiredException">javax.persistence.TransactionRequiredException: The method public abstract void javax.persistence.EntityManager.refresh(java.lang.Object) must be called in the context of a transaction. at weblogic.deployment.BasePersistenceContextProxyImpl.validateInvocation(BasePersistenceContextProxyImpl.java:121) at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:86) at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:89) at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80) at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:24) at $Proxy81.refresh(Unknown Source) at org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite.testPopulate(DelimitedPUTestSuite.java:99) at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:411) at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87) If I commented out "em.refresh(pn);" in testPopulate in line 99, The testReadEmployee failed with the following exception: <failure message="testCreateEmployee emp not properly persisted" type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError: testCreateEmployee emp not properly persisted at org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite.testReadEmployee(DelimitedPUTestSuite.java:114) at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:411) at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87) at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:187) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:154) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:126) at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:114) at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:176) at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:15) at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54) Note: only "compareObjects(emp, returnedEmp)" failed, "compareObjects(emp2, returnedWorker)" passed.
Moved refresh inside a transaction
After put em.refresh(pn) within a transaction, testPopulate failed with the following exception: <testcase classname="org.eclipse.persistence.testing.tests.jpa.delimited.DelimitedPUTestSuite" name="testPopulate" time="7.438"> <error message="Can not refresh not managed object: PhoneNumber[work]: (709) 555-1234." type="java.lang.IllegalArgumentException">java.lang.IllegalArgumentException: Can not refresh not managed object: PhoneNumber[work]: (709) 555-1234. at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(EntityManagerImpl.java:769) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.refresh(EntityManagerImpl.java:675) at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:90) at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:89) at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80) at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:24) at $Proxy65.refresh(Unknown Source) but testReadEmployee passed.
Updated to properly set id in phoneNumber.setOwner()
Should be address by change above.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink