NIHVIVO-2769 (inference rebuild model should be cleared out at the end of an inference recompute)
This commit is contained in:
parent
851eb31119
commit
aa14f34a60
1 changed files with 6 additions and 1 deletions
|
@ -959,6 +959,9 @@ public class SimpleReasoner extends StatementListener {
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Exception while recomputing ABox inference model", e);
|
log.error("Exception while recomputing ABox inference model", e);
|
||||||
|
inferenceRebuildModel.removeAll(); // don't do this in the finally, it's needed in the case
|
||||||
|
// where there isn't an exception
|
||||||
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
aboxModel.leaveCriticalSection();
|
aboxModel.leaveCriticalSection();
|
||||||
tboxModel.leaveCriticalSection();
|
tboxModel.leaveCriticalSection();
|
||||||
|
@ -967,7 +970,7 @@ public class SimpleReasoner extends StatementListener {
|
||||||
|
|
||||||
// reflect the recomputed inferences into the application inference
|
// reflect the recomputed inferences into the application inference
|
||||||
// model.
|
// model.
|
||||||
inferenceRebuildModel.enterCriticalSection(Lock.READ);
|
inferenceRebuildModel.enterCriticalSection(Lock.WRITE);
|
||||||
scratchpadModel.enterCriticalSection(Lock.WRITE);
|
scratchpadModel.enterCriticalSection(Lock.WRITE);
|
||||||
log.info("Updating ABox inference model");
|
log.info("Updating ABox inference model");
|
||||||
// Remove everything from the current inference model that is not
|
// Remove everything from the current inference model that is not
|
||||||
|
@ -1029,6 +1032,8 @@ public class SimpleReasoner extends StatementListener {
|
||||||
inferenceModel.leaveCriticalSection();
|
inferenceModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
inferenceRebuildModel.removeAll();
|
||||||
|
scratchpadModel.removeAll();
|
||||||
inferenceRebuildModel.leaveCriticalSection();
|
inferenceRebuildModel.leaveCriticalSection();
|
||||||
scratchpadModel.leaveCriticalSection();
|
scratchpadModel.leaveCriticalSection();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue