NIHVIVO-2119 VitroJenaSDBModelMaker reconnection bug
This commit is contained in:
parent
d030423d9c
commit
48d52f77cf
1 changed files with 13 additions and 10 deletions
|
@ -109,24 +109,27 @@ public class VitroJenaSDBModelMaker implements ModelMaker {
|
||||||
try {
|
try {
|
||||||
if (!StoreUtils.isFormatted(store)) {
|
if (!StoreUtils.isFormatted(store)) {
|
||||||
// initialize the store
|
// initialize the store
|
||||||
store.getTableFormatter().create();
|
try {
|
||||||
store.getTableFormatter().truncate();
|
store.getTableFormatter().create();
|
||||||
|
store.getTableFormatter().truncate();
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException(
|
||||||
|
"Unable to format store for " +
|
||||||
|
"VitroJenaSDBModelMaker", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (SQLException sqle) {
|
} catch (SQLException sqle) {
|
||||||
conn.close();
|
conn.close();
|
||||||
conn = null;
|
conn = null;
|
||||||
throw new RuntimeException(
|
|
||||||
"Unable to set up SDB store for model maker", sqle);
|
|
||||||
}
|
}
|
||||||
if (!isWorking(store)) {
|
if (conn != null) {
|
||||||
if (conn != null) {
|
if (isWorking(store)) {
|
||||||
|
goodStore = true;
|
||||||
|
} else {
|
||||||
conn.close();
|
conn.close();
|
||||||
conn = null;
|
conn = null;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
|
||||||
goodStore = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (store == null) {
|
if (store == null) {
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
|
|
Loading…
Add table
Reference in a new issue