summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSabine Heider2012-08-15 05:58:42 (EDT)
committer tware2012-09-14 15:16:14 (EDT)
commita3db955a250961185d00af5254c0663b97570cea (patch)
tree101fa336f6b64796cf8929f8b7cf6b1e0ccc8499
parent35e0b7ce848d24686f800a6872be400c49e4f3cb (diff)
downloadeclipselink.runtime-a3db955a250961185d00af5254c0663b97570cea.zip
eclipselink.runtime-a3db955a250961185d00af5254c0663b97570cea.tar.gz
eclipselink.runtime-a3db955a250961185d00af5254c0663b97570cea.tar.bz2
HANAPlatform: Disable tests that perform SELECT FOR UPDATE on multiple tables
HANA currently doesn't support pessimistic locking with queries on multiple tables. The feature is under development but hte thest should be skipped for the time being. See bug 384129 Signed-off-by: Sabine Heider <sabine.heider@sap.com>
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java246
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/PessimisticLockingExtendedScopeTestSuite.java15
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTestSuite.java30
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/AdvancedQueryTestSuite.java20
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java5
5 files changed, 207 insertions, 109 deletions
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java
index 7445475..43137e1 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/EntityManagerJUnitTestSuite.java
@@ -1779,133 +1779,151 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
}
public void testPESSIMISTIC_FORCE_INCREMENTLock() {
- if (isSelectForUpateSupported()) {
- Employee employee = null;
- Integer version1;
+ if (!isSelectForUpateSupported()) {
+ return;
+ }
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
+ Employee employee = null;
+ Integer version1;
- EntityManager em = createEntityManager();
-
- try {
- beginTransaction(em);
- employee = new Employee();
- employee.setFirstName("Guillaume");
- employee.setLastName("Aujet");
- em.persist(employee);
- commitTransaction(em);
- } catch (RuntimeException ex) {
- if (isTransactionActive(em)) {
- rollbackTransaction(em);
- }
-
- closeEntityManager(em);
- throw ex;
+ EntityManager em = createEntityManager();
+
+ try {
+ beginTransaction(em);
+ employee = new Employee();
+ employee.setFirstName("Guillaume");
+ employee.setLastName("Aujet");
+ em.persist(employee);
+ commitTransaction(em);
+ } catch (RuntimeException ex) {
+ if (isTransactionActive(em)) {
+ rollbackTransaction(em);
}
-
- version1 = employee.getVersion();
-
- try {
- beginTransaction(em);
- employee = em.find(Employee.class, employee.getId(), LockModeType.PESSIMISTIC_FORCE_INCREMENT);
- commitTransaction(em);
-
- assertTrue("The version was not updated on the pessimistic lock.", version1.intValue() < employee.getVersion().intValue());
- } catch (RuntimeException ex) {
- if (isTransactionActive(em)) {
- rollbackTransaction(em);
- }
-
- throw ex;
- } finally {
- closeEntityManager(em);
+
+ closeEntityManager(em);
+ throw ex;
+ }
+
+ version1 = employee.getVersion();
+
+ try {
+ beginTransaction(em);
+ employee = em.find(Employee.class, employee.getId(), LockModeType.PESSIMISTIC_FORCE_INCREMENT);
+ commitTransaction(em);
+
+ assertTrue("The version was not updated on the pessimistic lock.", version1.intValue() < employee.getVersion().intValue());
+ } catch (RuntimeException ex) {
+ if (isTransactionActive(em)) {
+ rollbackTransaction(em);
}
+
+ throw ex;
+ } finally {
+ closeEntityManager(em);
}
}
public void testPESSIMISTIC_READLockWithNoChanges() {
// Cannot create parallel entity managers in the server.
- if (! isOnServer() && isSelectForUpateSupported()) {
- Employee employee = null;
- Integer version1;
+ if (isOnServer() || !isSelectForUpateSupported()) {
+ return;
+ }
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
+ Employee employee = null;
+ Integer version1;
- EntityManager em = createEntityManager();
-
- try {
- beginTransaction(em);
- employee = new Employee();
- employee.setFirstName("Black");
- employee.setLastName("Crappie");
- em.persist(employee);
- commitTransaction(em);
- } catch (RuntimeException ex) {
- if (isTransactionActive(em)) {
- rollbackTransaction(em);
- }
-
- closeEntityManager(em);
- throw ex;
+ EntityManager em = createEntityManager();
+
+ try {
+ beginTransaction(em);
+ employee = new Employee();
+ employee.setFirstName("Black");
+ employee.setLastName("Crappie");
+ em.persist(employee);
+ commitTransaction(em);
+ } catch (RuntimeException ex) {
+ if (isTransactionActive(em)) {
+ rollbackTransaction(em);
}
-
- version1 = employee.getVersion();
-
- try {
- beginTransaction(em);
- employee = em.find(Employee.class, employee.getId(), LockModeType.PESSIMISTIC_READ);
- commitTransaction(em);
-
- assertTrue("The version was updated on the pessimistic lock.", version1.intValue() == employee.getVersion().intValue());
- } catch (RuntimeException ex) {
- if (isTransactionActive(em)) {
- rollbackTransaction(em);
- }
-
- throw ex;
- } finally {
- closeEntityManager(em);
+
+ closeEntityManager(em);
+ throw ex;
+ }
+
+ version1 = employee.getVersion();
+
+ try {
+ beginTransaction(em);
+ employee = em.find(Employee.class, employee.getId(), LockModeType.PESSIMISTIC_READ);
+ commitTransaction(em);
+
+ assertTrue("The version was updated on the pessimistic lock.", version1.intValue() == employee.getVersion().intValue());
+ } catch (RuntimeException ex) {
+ if (isTransactionActive(em)) {
+ rollbackTransaction(em);
}
+
+ throw ex;
+ } finally {
+ closeEntityManager(em);
}
}
public void testPESSIMISTIC_WRITELockWithNoChanges() {
// Cannot create parallel entity managers in the server.
- if (! isOnServer() && isSelectForUpateSupported()) {
- Employee employee = null;
- Integer version1;
-
- EntityManager em = createEntityManager();
-
- try {
- beginTransaction(em);
- employee = new Employee();
- employee.setFirstName("Black");
- employee.setLastName("Crappie");
- em.persist(employee);
- commitTransaction(em);
- } catch (RuntimeException ex) {
- if (isTransactionActive(em)) {
- rollbackTransaction(em);
- }
-
- closeEntityManager(em);
- throw ex;
+ if (isOnServer() || !isSelectForUpateSupported()) {
+ return;
+ }
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
+ Employee employee = null;
+ Integer version1;
+
+ EntityManager em = createEntityManager();
+
+ try {
+ beginTransaction(em);
+ employee = new Employee();
+ employee.setFirstName("Black");
+ employee.setLastName("Crappie");
+ em.persist(employee);
+ commitTransaction(em);
+ } catch (RuntimeException ex) {
+ if (isTransactionActive(em)) {
+ rollbackTransaction(em);
}
-
- version1 = employee.getVersion();
-
- try {
- beginTransaction(em);
- employee = em.find(Employee.class, employee.getId(), LockModeType.PESSIMISTIC_WRITE);
- commitTransaction(em);
-
- assertTrue("The version was updated on the pessimistic lock.", version1.intValue() == employee.getVersion().intValue());
- } catch (RuntimeException ex) {
- if (isTransactionActive(em)) {
- rollbackTransaction(em);
- }
-
- throw ex;
- } finally {
- closeEntityManager(em);
+
+ closeEntityManager(em);
+ throw ex;
+ }
+
+ version1 = employee.getVersion();
+
+ try {
+ beginTransaction(em);
+ employee = em.find(Employee.class, employee.getId(), LockModeType.PESSIMISTIC_WRITE);
+ commitTransaction(em);
+
+ assertTrue("The version was updated on the pessimistic lock.", version1.intValue() == employee.getVersion().intValue());
+ } catch (RuntimeException ex) {
+ if (isTransactionActive(em)) {
+ rollbackTransaction(em);
}
+
+ throw ex;
+ } finally {
+ closeEntityManager(em);
}
}
@@ -2176,6 +2194,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
if (isOnServer() || !isSelectForUpateSupported() || !isPessimisticWriteLockSupported()) {
return;
}
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
ServerSession ss = ((JpaEntityManagerFactory)getEntityManagerFactory()).getServerSession();
@@ -8207,6 +8230,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
if (!isSelectForUpateSupported()) {
return;
}
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
EntityManagerImpl em = (EntityManagerImpl)createEntityManager();
beginTransaction(em);
Query query = em.createNamedQuery("findAllEmployeesByFirstName");
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/PessimisticLockingExtendedScopeTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/PessimisticLockingExtendedScopeTestSuite.java
index 6f0283f..338eefc 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/PessimisticLockingExtendedScopeTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/advanced/PessimisticLockingExtendedScopeTestSuite.java
@@ -218,6 +218,11 @@ import org.eclipse.persistence.testing.models.jpa.advanced.entities.EntyE;
warning("This test deadlocks on SQL Server");
return;
}
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
final Employee emp = new Employee();
final Actor actor = new Actor<Employee>() {
@@ -488,6 +493,11 @@ import org.eclipse.persistence.testing.models.jpa.advanced.entities.EntyE;
warning("This test deadlocks on SQL Server");
return;
}
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateSupported()) {
EntityManager em = createEntityManager();
@@ -549,6 +559,11 @@ import org.eclipse.persistence.testing.models.jpa.advanced.entities.EntyE;
warning("This test deadlocks on SQL Server");
return;
}
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateSupported()) {
EntityManager em = createEntityManager();
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTestSuite.java
index 571bb28..5e4ab45 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/composite/advanced/EntityManagerJUnitTestSuite.java
@@ -1927,6 +1927,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
}
public void testPESSIMISTIC_FORCE_INCREMENTLock() {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
if (isSelectForUpateSupported()) {
Employee employee = null;
Integer version1;
@@ -1970,6 +1975,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
}
public void testPESSIMISTIC_READLockWithNoChanges() {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateSupported()) {
Employee employee = null;
@@ -2014,6 +2024,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
}
public void testPESSIMISTIC_WRITELockWithNoChanges() {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateSupported()) {
Employee employee = null;
@@ -2203,6 +2218,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
// skip this test (bug 326799)
return;
}
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateNoWaitSupported()) {
@@ -4799,6 +4819,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
+ "Symfoware doesn't support UpdateAll/DeleteAll on multi-table objects (see rfe 298193).");
return;
}
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
if (isSelectForUpateSupported()) {
EntityManager em = createEntityManager();
try {
@@ -7484,6 +7509,11 @@ public class EntityManagerJUnitTestSuite extends JUnitTestCase {
// gf 3032
public void testPessimisticLockHintStartsTransaction(){
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
if (isOnServer()) {
// Extended persistence context are not supported in the server.
return;
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/AdvancedQueryTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/AdvancedQueryTestSuite.java
index e62fb48..8369b28 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/AdvancedQueryTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/AdvancedQueryTestSuite.java
@@ -1129,6 +1129,11 @@ public class AdvancedQueryTestSuite extends JUnitTestCase {
}
public void testQueryPESSIMISTIC_READLock() {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateSupported()) {
EntityManager em = createEntityManager();
@@ -1178,6 +1183,11 @@ public class AdvancedQueryTestSuite extends JUnitTestCase {
}
public void testQueryPESSIMISTIC_WRITELock() {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateSupported()) {
EntityManager em = createEntityManager();
@@ -1227,6 +1237,11 @@ public class AdvancedQueryTestSuite extends JUnitTestCase {
}
public void testQueryPESSIMISTIC_FORCE_INCREMENTLock() {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
if (isSelectForUpateSupported()) {
Employee employee = null;
Integer version1;
@@ -1419,6 +1434,11 @@ public class AdvancedQueryTestSuite extends JUnitTestCase {
}
public void testLockWithSecondaryTable() {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// Cannot create parallel entity managers in the server.
if (! isOnServer() && isSelectForUpateSupported()) {
EntityManager em = createEntityManager();
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
index 31b5abf..715b38b 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/JUnitJPQLComplexTestSuite.java
@@ -4225,6 +4225,11 @@ public class JUnitJPQLComplexTestSuite extends JUnitTestCase
* or rolled back.
*/
public void testPessimisticLock() throws InterruptedException {
+ if ((JUnitTestCase.getServerSession()).getPlatform().isHANA()) {
+ // HANA currently doesn't support pessimistic locking with queries on multiple tables
+ // feature is under development (see bug 384129), but test should be skipped for the time being
+ return;
+ }
// test uses entity managers in a way that is disallowed in our server framework
if (isOnServer() || !isSelectForUpateSupported()){
return;