From 22fd88d9e0bf0754b82b98a94e131da05a4cda95 Mon Sep 17 00:00:00 2001 From: Scott Marlow Date: Tue, 10 Dec 2024 18:41:46 -0500 Subject: [PATCH] read db.supports.sequence from passed setup properties and remove extra create of SEQGENERATOR Signed-off-by: Scott Marlow --- .../tck/persistence/core/types/generator/Client.java | 12 ------------ .../persistence/core/types/generator/Client1.java | 3 +-- .../persistence/core/types/generator/Client2.java | 3 +-- .../persistence/core/types/generator/Client3.java | 3 +-- .../persistence/core/types/generator/Client4.java | 3 +-- 5 files changed, 4 insertions(+), 20 deletions(-) diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client.java index b5434fd451..8923a71acf 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client.java @@ -35,18 +35,6 @@ public class Client extends PMClientBase { public Client() { } - protected void createSequenceGenerator() { - try { - getEntityTransaction().begin(); - getEntityManager().createNativeQuery("CREATE SEQUENCE SEQGENERATOR START WITH 10").executeUpdate(); - getEntityTransaction().commit(); - } catch (Exception e) { - logErr( "Exception encountered while creating seq:", e); - } - - } - - public void cleanup() throws Exception { try { logTrace( "Cleanup data"); diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client1.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client1.java index bf8849a37a..89c0bd09c6 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client1.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client1.java @@ -61,12 +61,11 @@ public void setup(String[] args, Properties p) throws Exception { try { super.setup(args,p); - String s = System.getProperty("db.supports.sequence"); + String s = p.getProperty("db.supports.sequence"); if (s != null) { supports_sequence = Boolean.parseBoolean(s); logMsg( "db.supports.sequence:" + supports_sequence); if (supports_sequence) { - createSequenceGenerator(); removeTestData(); createTestData(); } diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client2.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client2.java index fcffb1a4cc..c033ce84e0 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client2.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client2.java @@ -45,12 +45,11 @@ public void setup(String[] args, Properties p) throws Exception { try { super.setup(args,p); - String s = System.getProperty("db.supports.sequence"); + String s = p.getProperty("db.supports.sequence"); if (s != null) { supports_sequence = Boolean.parseBoolean(s); logMsg( "db.supports.sequence:" + supports_sequence); if (supports_sequence) { - createSequenceGenerator(); removeTestData(); createDataTypes2Data(); } diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client3.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client3.java index 546472ce2b..23423ffaa4 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client3.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client3.java @@ -50,12 +50,11 @@ public void setup(String[] args, Properties p) throws Exception { try { super.setup(args,p); - String s = System.getProperty("db.supports.sequence"); + String s = p.getProperty("db.supports.sequence"); if (s != null) { supports_sequence = Boolean.parseBoolean(s); logMsg( "db.supports.sequence:" + supports_sequence); if (supports_sequence) { - createSequenceGenerator(); removeTestData(); createDataTypes3Data(); } diff --git a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client4.java b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client4.java index 9869544f47..bc61c747fb 100644 --- a/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client4.java +++ b/jpa/spec-tests/src/main/java/ee/jakarta/tck/persistence/core/types/generator/Client4.java @@ -49,12 +49,11 @@ public void setup(String[] args, Properties p) throws Exception { try { super.setup(args,p); - String s = System.getProperty("db.supports.sequence"); + String s = p.getProperty("db.supports.sequence"); if (s != null) { supports_sequence = Boolean.parseBoolean(s); logMsg( "db.supports.sequence:" + supports_sequence); if (supports_sequence) { - createSequenceGenerator(); removeTestData(); createDataTypes4Data(); }