Skip to content

Commit

Permalink
new Hibernate requires DB.open before createSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
ar committed Aug 24, 2016
1 parent 6c47081 commit 0eadb4a
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@

package org.jpos.q2.cli;

import org.jpos.ee.DB;
import org.jpos.q2.CLICommand;
import org.jpos.q2.CLIContext;

@SuppressWarnings("unused")
public class CREATESCHEMA implements CLICommand {
@Override
public void exec(CLIContext cli, String[] args) throws Exception {
Expand All @@ -30,6 +32,11 @@ public void exec(CLIContext cli, String[] args) throws Exception {
filename = args[1];
if (args.length > 2)
create = "yes".equalsIgnoreCase(args[2]) || "true".equalsIgnoreCase(args[2]);
try (DB db = new DB()) {
db.open();
db.beginTransaction();
db.createSchema(filename, create);
}
new org.jpos.ee.DB().createSchema(filename, create);
}
}

0 comments on commit 0eadb4a

Please sign in to comment.