improvement to VitroJenaSDBModelMaker prompted by NIHVIVO-2119 (merge to trunk)
This commit is contained in:
parent
57d3d0df79
commit
7d69145534
1 changed files with 4 additions and 4 deletions
|
@ -94,14 +94,12 @@ public class VitroJenaSDBModelMaker implements ModelMaker {
|
|||
private Store getStore() {
|
||||
Store store = null;
|
||||
boolean goodStore = false;
|
||||
boolean badConn = false;
|
||||
int tries = 0;
|
||||
while (!goodStore && tries < MAX_TRIES) {
|
||||
tries++;
|
||||
if (conn == null || badConn) {
|
||||
if (conn == null) {
|
||||
try {
|
||||
conn = new SDBConnection(bds.getConnection());
|
||||
badConn = false;
|
||||
} catch (SQLException sqle) {
|
||||
throw new RuntimeException(
|
||||
"Unable to get SQL connection", sqle);
|
||||
|
@ -115,13 +113,15 @@ public class VitroJenaSDBModelMaker implements ModelMaker {
|
|||
store.getTableFormatter().truncate();
|
||||
}
|
||||
} catch (SQLException sqle) {
|
||||
conn.close();
|
||||
conn = null;
|
||||
throw new RuntimeException(
|
||||
"Unable to set up SDB store for model maker", sqle);
|
||||
}
|
||||
if (!isWorking(store)) {
|
||||
if (conn != null) {
|
||||
conn.close();
|
||||
badConn = true;
|
||||
conn = null;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue