summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorSabine Heider2012-12-11 06:47:42 (EST)
committer tware2013-01-10 13:52:20 (EST)
commite73b77f46711d0c0bfa67e2464a061512c8c8cdb (patch)
tree8501e2b09a93458a98e9b7c7639137971221ff35
parente58773fed7d9b601e54943ce80a297f283c75fe7 (diff)
downloadeclipselink.runtime-e73b77f46711d0c0bfa67e2464a061512c8c8cdb.zip
eclipselink.runtime-e73b77f46711d0c0bfa67e2464a061512c8c8cdb.tar.gz
eclipselink.runtime-e73b77f46711d0c0bfa67e2464a061512c8c8cdb.tar.bz2
Always use TYPE_FORWARD_ONLY and CONCUR_READ_ONLY on SAP HANA database
SAP HANA database supports only the result set type TYPE_FORWARD_ONLY with concurrency mode CONCUR_READ_ONLY. Change the tests so that they use these settings when executed on SAP HANA database. See bug 384116 Signed-off-by: Sabine Heider <sabine.heider@sap.com>
-rw-r--r--foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/queries/QueryFrameworkTestSuite.java9
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedCriteriaQueryTestSuite.java7
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedQueryTestSuite.java7
-rw-r--r--jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/jpql/AdvancedQueryTestSuite.java7
4 files changed, 26 insertions, 4 deletions
diff --git a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/queries/QueryFrameworkTestSuite.java b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/queries/QueryFrameworkTestSuite.java
index d31ad3c..1f658cf 100644
--- a/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/queries/QueryFrameworkTestSuite.java
+++ b/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/queries/QueryFrameworkTestSuite.java
@@ -461,7 +461,14 @@ public class QueryFrameworkTestSuite extends TestSuite {
TYPE_SCROLL_INSENSITIVE_isSupported = false;
CONCUR_UPDATABLE_isSupported = false;
}
- if(TYPE_SCROLL_INSENSITIVE_isSupported && CONCUR_UPDATABLE_isSupported) {
+ // HANA supports only TYPE_FORWARD_ONLY and CONCUR_READ_ONLY, see bug 384116
+ if (getSession().getPlatform().isHANA()) {
+ ScrollableCursorPolicy policy = new ScrollableCursorPolicy();
+ policy.setResultSetType(ScrollableCursorPolicy.TYPE_FORWARD_ONLY);
+ policy.setResultSetConcurrency(ScrollableCursorPolicy.CONCUR_READ_ONLY);
+ policy.setPageSize(10);
+ query.useScrollableCursor(policy);
+ } else if(TYPE_SCROLL_INSENSITIVE_isSupported && CONCUR_UPDATABLE_isSupported) {
query.useScrollableCursor();
} else {
ScrollableCursorPolicy policy = new ScrollableCursorPolicy();
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedCriteriaQueryTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedCriteriaQueryTestSuite.java
index 8a5a35d..ecd3095 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedCriteriaQueryTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedCriteriaQueryTestSuite.java
@@ -1179,7 +1179,12 @@ public class AdvancedCriteriaQueryTestSuite extends JUnitTestCase {
jpaQuery = (JpaQuery)((EntityManager)em.getDelegate()).createQuery(em.getCriteriaBuilder().createQuery(Employee.class));
jpaQuery.setHint(QueryHints.SCROLLABLE_CURSOR, true);
jpaQuery.setHint(QueryHints.RESULT_SET_CONCURRENCY, ResultSetConcurrency.ReadOnly);
- jpaQuery.setHint(QueryHints.RESULT_SET_TYPE, ResultSetType.DEFAULT);
+ String resultSetType = ResultSetType.DEFAULT;
+ // HANA supports only TYPE_FORWARD_ONLY, see bug 384116
+ if (getPlatform().isHANA()) {
+ resultSetType = ResultSetType.ForwardOnly;
+ }
+ jpaQuery.setHint(QueryHints.RESULT_SET_TYPE, resultSetType);
ScrollableCursor scrollableCursor = (ScrollableCursor)jpaQuery.getResultCursor();
scrollableCursor.next();
scrollableCursor.close();
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedQueryTestSuite.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedQueryTestSuite.java
index a7904bf..38c000f 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedQueryTestSuite.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/tests/jpa/criteria/AdvancedQueryTestSuite.java
@@ -239,7 +239,12 @@ public class AdvancedQueryTestSuite extends JUnitTestCase {
jpaQuery = (JpaQuery)((EntityManager)em.getDelegate()).createQuery(em.getCriteriaBuilder().createQuery(Employee.class));
jpaQuery.setHint(QueryHints.SCROLLABLE_CURSOR, true);
jpaQuery.setHint(QueryHints.RESULT_SET_CONCURRENCY, ResultSetConcurrency.ReadOnly);
- jpaQuery.setHint(QueryHints.RESULT_SET_TYPE, ResultSetType.DEFAULT);
+ String resultSetType = ResultSetType.DEFAULT;
+ // HANA supports only TYPE_FORWARD_ONLY, see bug 384116
+ if (getPlatform().isHANA()) {
+ resultSetType = ResultSetType.ForwardOnly;
+ }
+ jpaQuery.setHint(QueryHints.RESULT_SET_TYPE, resultSetType);
ScrollableCursor scrollableCursor = (ScrollableCursor)jpaQuery.getResultCursor();
scrollableCursor.next();
scrollableCursor.close();
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 8369b28..f426a15 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
@@ -405,7 +405,12 @@ public class AdvancedQueryTestSuite extends JUnitTestCase {
jpaQuery = (JpaQuery)((EntityManager)em.getDelegate()).createQuery("Select employee from Employee employee");
jpaQuery.setHint(QueryHints.SCROLLABLE_CURSOR, true);
jpaQuery.setHint(QueryHints.RESULT_SET_CONCURRENCY, ResultSetConcurrency.ReadOnly);
- jpaQuery.setHint(QueryHints.RESULT_SET_TYPE, ResultSetType.DEFAULT);
+ String resultSetType = ResultSetType.DEFAULT;
+ // HANA supports only TYPE_FORWARD_ONLY, see bug 384116
+ if (getPlatform().isHANA()) {
+ resultSetType = ResultSetType.ForwardOnly;
+ }
+ jpaQuery.setHint(QueryHints.RESULT_SET_TYPE, resultSetType);
ScrollableCursor scrollableCursor = (ScrollableCursor)jpaQuery.getResultCursor();
scrollableCursor.next();
scrollableCursor.close();