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

Bug 338727

Summary: There are two new failures with WDF testing on JavaSE
Product: z_Archived Reporter: Kevin Yuan <kevin.yuan>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: adrian.goerler, eclipselink.orm-inbox, jamesssss
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: test
Attachments:
Description Flags
proposed patch avoiding to call JPA 2 methods on Java EE 5 servers none

Description Kevin Yuan CLA 2011-03-02 15:20:22 EST
The following two new failures occurred with WDF testing on JavaSE against Oracle DB (11.1.0.7):
  1. org.eclipse.persistence.testing.tests.wdf.jpa1.query.TestDeleteQuery.testDeleteAllDepartments
  2. org.eclipse.persistence.testing.tests.wdf.jpa1.relation.TestBidirectionalManyToMany.testCascadeMerge
The following are stack trace, same for both failures:

javax.persistence.OptimisticLockException: Exception [EclipseLink-5011] (Eclipse Persistence Services - 2.3.0.v20110226-r9045): org.eclipse.persistence.exceptions.OptimisticLockException Exception Description: One or more objects cannot be updated because it has changed or been deleted since it was last read

On the other hand, all wdf testing couldn't run on those application servers which only support JPA1.0 (not support JPA2.0, e.g. JBoss-5.1.0GA). The following are stack trace:

javax.persistence.EntityManagerFactory.getCache()Ljavax/persistence/Cache;

java.lang.NoSuchMethodError: javax.persistence.EntityManagerFactory.getCache()Ljavax/persistence/Cache;
at org.eclipse.persistence.testing.framework.wdf.AbstractBaseTest.clearAllTables(AbstractBaseTest.java:376)
at org.eclipse.persistence.testing.framework.wdf.AbstractBaseTest.clearAllTablesAndSetup(AbstractBaseTest.java:328)
at org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner.runChild(SkipBugzillaTestRunner.java:178)
at org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner.runChild(SkipBugzillaTestRunner.java:38)
at org.eclipse.persistence.testing.framework.wdf.SkipBugzillaTestRunner.run(SkipBugzillaTestRunner.java:50)
at org.eclipse.persistence.testing.framework.wdf.server.ServerTestRunnerImpl.runTestClass(ServerTestRunnerImpl.java:49)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:54)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
Comment 1 Adrian Goerler CLA 2011-03-03 13:25:31 EST
Created attachment 190297 [details]
proposed patch avoiding to call JPA 2 methods on Java EE 5 servers

The patch uses getDelegate and reflection to invoke JPA 2 methods
Tested on JBoss 5.1 GA/Oracle 10
Comment 2 Adrian Goerler CLA 2011-03-04 05:30:23 EST
Tested on Oracle 11.1 with Oracle10Platform and Oracle11Platform

Checked in at # 9072.
Comment 3 Adrian Goerler CLA 2011-03-04 05:32:54 EST
(In reply to comment #2)
> Tested on Oracle 11.1 with Oracle10Platform and Oracle11Platform
> Checked in at # 9072.

The comment above is wrong. Correct is

Test on 
- JBoss 5.1 (by Adrian)
- WLS 10.3.4 (by Kevin)

Checke in at # 9072.
Comment 4 James Sutherland CLA 2011-05-26 11:02:01 EDT
The JPA 2.0 issue was fixed, but not the optimistic lock error, which is the reason for this bug.
Comment 5 Adrian Goerler CLA 2011-05-27 09:30:52 EDT
I have retested this issue:

the OLE reported here occurs with the Oracle10Platform or with the Oracle11Platfrom. Applpying the patch 

https://bugs.eclipse.org/bugs/attachment.cgi?id=190269

fixes the issue.

With the generic OraclePlatfrom, the issue does not occur.
Comment 6 Adrian Goerler CLA 2011-05-27 11:49:44 EDT
The two test issues, which occur on Oracle with the Oracle10Platform or Oracle11Platform, namely

TestDeleteQuery.testDeleteAllDepartment

and 

TestBidirectionalManyToMany.testCascadeMerge

are addressed by the bug 338783. Hence I am closing this issue as duplicate of 338783.

*** This bug has been marked as a duplicate of bug 338783 ***
Comment 7 Eclipse Webmaster CLA 2022-06-09 10:27:11 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink