Skip to content

Commit

Permalink
Merge pull request #1700 from scottmarlow/web-jpa
Browse files Browse the repository at this point in the history
read db.supports.sequence from passed setup properties and remove extra create of SEQGENERATOR
  • Loading branch information
scottmarlow authored Dec 11, 2024
2 parents d93f123 + 22fd88d commit 7dc120c
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 7dc120c

Please sign in to comment.