NIHVIVO-2096 bugfix for initializing SDB ingest tool model maker in RDB mode

This commit is contained in:
bjl23 2011-02-09 20:31:33 +00:00
parent dbb222f655
commit 17fcba922c

View file

@ -64,12 +64,7 @@ public class VitroJenaSDBModelMaker implements ModelMaker {
this.bds = bds; this.bds = bds;
Store store = getStore(); Store store = getStore();
try { try {
if (!StoreUtils.isFormatted(store)) {
// initialize the store
store.getTableFormatter().create();
store.getTableFormatter().truncate();
}
Model metadataModel = getMetadataModel(); Model metadataModel = getMetadataModel();
if (metadataModel.size()==0) { if (metadataModel.size()==0) {
@ -113,6 +108,16 @@ public class VitroJenaSDBModelMaker implements ModelMaker {
} }
} }
store = SDBFactory.connectStore(conn, storeDesc); store = SDBFactory.connectStore(conn, storeDesc);
try {
if (!StoreUtils.isFormatted(store)) {
// initialize the store
store.getTableFormatter().create();
store.getTableFormatter().truncate();
}
} catch (SQLException sqle) {
throw new RuntimeException(
"Unable to set up SDB store for model maker", sqle);
}
if (!isWorking(store)) { if (!isWorking(store)) {
if (conn != null) { if (conn != null) {
conn.close(); conn.close();