Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 384129 - SAP HANA Database doesn't support FOR UPDATE with queries that select from multiple tables
Summary: SAP HANA Database doesn't support FOR UPDATE with queries that select from mu...
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Tom Ware CLA
QA Contact:
URL:
Whiteboard: submitted_patch
Keywords:
Depends on:
Blocks: 383862
  Show dependency tree
 
Reported: 2012-07-03 06:54 EDT by Sabine Heider CLA
Modified: 2022-06-09 10:09 EDT (History)
2 users (show)

See Also:


Attachments
Patch containing the modified tests (5.39 KB, patch)
2012-07-03 07:09 EDT, Sabine Heider CLA
tom.ware: iplog+
Details | Diff
Patch containing the second part of the modified tests (22.79 KB, patch)
2012-09-12 17:42 EDT, Sabine Heider CLA
no flags Details | Diff
Patch fixing the exceptions in WebLogic server tests (2.32 KB, patch)
2012-09-25 03:28 EDT, Sabine Heider CLA
tom.ware: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sabine Heider CLA 2012-07-03 06:54:32 EDT
SAP HANA Database supports SELECT FOR UPDATE in principle. However, FOR UPDATE is not supported with queries that select from multiple tables, such as queries that contain a join or a subselect.

Some of the pessimistic locking tests operate on a data model that leads to join queries. Those tests are therefore skipped on SAP HANA Database.

Affected tests:
* foundation: package org.eclipse.persistence.testing.tests.queries 
    - PessimisticLockEmptyTransactionTest
    - PessimisticLockTest
* jpa: package org.eclipse.persistence.testing.tests.jpa.advanced 
    - EntityManagerJUnitTestSuite.testGetLockModeType()

I'll attach containing the modified tests.
Comment 1 Sabine Heider CLA 2012-07-03 07:09:10 EDT
Created attachment 218205 [details]
Patch containing the modified tests
Comment 2 Tom Ware CLA 2012-07-05 10:44:34 EDT
Checked in changes as submitted

Reviewed by: Tom Ware - reviewed submitted changes
Comment 3 Sabine Heider CLA 2012-08-03 04:56:29 EDT
FEATURE UPDATE: I got the info from SAP HANA development that SELECT FOR UPDATE on JOINs is being developed and will be available with one of the next support packages. As a timeline, I would expect the feature to be available by end of 2012/beginning 2013 (without any guarantee, of course).
Comment 4 Sabine Heider CLA 2012-09-12 17:38:54 EDT
Some more tests are affected by the same issue:

* jpa: package org.eclipse.persistence.testing.tests.jpa.advanced 
    - EntityManagerJUnitTestSuite.testPESSIMISTIC_FORCE_INCREMENTLock()
    - EntityManagerJUnitTestSuite.testPESSIMISTIC_READLockWithNoChanges()
    - EntityManagerJUnitTestSuite.testPESSIMISTIC_WRITELockWithNoChanges()
    - EntityManagerJUnitTestSuite.testPESSIMISTIC_ExtendedScope()
    - EntityManagerJUnitTestSuite.testPessimisticLockHintStartsTransaction()
    - PessimisticLockingExtendedScopeTestSuite.testPESSMISTIC_ES4()
    - PessimisticLockingExtendedScopeTestSuite.testPESSMISTIC_ES8()
    - PessimisticLockingExtendedScopeTestSuite.testPESSMISTIC_ES9()

       package org.eclipse.persistence.testing.tests.jpa.composite.advanced 
    - EntityManagerJUnitTestSuite.testPESSIMISTIC_FORCE_INCREMENTLock()
    - EntityManagerJUnitTestSuite.testPESSIMISTIC_READLockWithNoChanges()
    - EntityManagerJUnitTestSuite.testPESSIMISTIC_WRITELockWithNoChanges()
    - EntityManagerJUnitTestSuite.testLockWithJoinedInheritanceStrategy()
    - EntityManagerJUnitTestSuite.testGetLockModeType()
    - EntityManagerJUnitTestSuite.testPessimisticLockHintStartsTransaction()

       package org.eclipse.persistence.testing.tests.jpa.jpql
    - AdvancedQueryTestSuite.testQueryPESSIMISTIC_READLock()
    - AdvancedQueryTestSuite.testQueryPESSIMISTIC_WRITELock()
    - AdvancedQueryTestSuite.testQueryPESSIMISTIC_FORCE_INCREMENTLock()
    - AdvancedQueryTestSuite.testLockWithSecondaryTable()
    - JUnitJPQLComplexTestSuite.testPessimisticLock()

I will attach another patch file to skip those tests as well.
Comment 5 Sabine Heider CLA 2012-09-12 17:42:12 EDT
Created attachment 221000 [details]
Patch containing the second part of the modified tests

The patch caused whitespace errors when I tried to apply it. I attach it anyway because I don't know why or how to prevent that.
Comment 6 Tom Ware CLA 2012-09-14 15:14:24 EDT
Additional changes checked in.
Comment 7 Sabine Heider CLA 2012-09-24 05:27:30 EDT
Kevin Yuan informed me that the latest patch caused 6 failures in the server tests executed on WebLogic:

java.lang.ClassCastException: org.eclipse.persistence.sessions.broker.SessionBroker
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.getServerSession(EntityManagerImpl.java:1403)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.getServerSession(JUnitTestCase.java:457)
at org.eclipse.persistence.testing.tests.jpa.composite.advanced.EntityManagerJUnitTestSuite.testGetLockModeType(EntityManagerJUnitTestSuite.java:4822)
at org.eclipse.persistence.testing.framework.junit.JUnitTestCase.runBareServer(JUnitTestCase.java:663)
at org.eclipse.persistence.testing.framework.server.TestRunnerBean.runTest(TestRunnerBean.java:87)
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)
at $Proxy294.runTest(Unknown Source)
at org.eclipse.persistence.testing.framework.server.TestRunner_q0mh0s_TestRunnerImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at org.eclipse.persistence.testing.framework.server.TestRunner_q0mh0s_TestRunnerImpl.runTest(Unknown Source)
at org.eclipse.persistence.testing.framework.server.TestRunner_q0mh0s_TestRunnerImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:668)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:523)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:119)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

I'll provide a patch for that and have him check it first. If it works I'll attach the patch here.
Comment 8 Sabine Heider CLA 2012-09-25 03:28:34 EDT
Created attachment 221452 [details]
Patch fixing the exceptions in WebLogic server tests

The patch fixes the problems observed in the WebLogic server tests. Kevin Yuan already verified the patch and confirmed that it works.
Comment 9 Tom Ware CLA 2012-09-25 08:22:34 EDT
Checked in additional change.
Comment 10 Eclipse Webmaster CLA 2022-06-09 10:09:17 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink