Abort TDB write transaction before ending if not successfully committed (#230)
This commit is contained in:
parent
1819fa1dd4
commit
3c04cc0f80
1 changed files with 13 additions and 5 deletions
|
@ -77,10 +77,18 @@ public class RDFServiceTDB extends RDFServiceJena {
|
||||||
notifyListenersOfPreChangeEvents(changeSet);
|
notifyListenersOfPreChangeEvents(changeSet);
|
||||||
|
|
||||||
dataset.begin(ReadWrite.WRITE);
|
dataset.begin(ReadWrite.WRITE);
|
||||||
try {
|
try {
|
||||||
applyChangeSetToModel(changeSet, dataset);
|
boolean committed = false;
|
||||||
dataset.commit();
|
try {
|
||||||
} finally {
|
applyChangeSetToModel(changeSet, dataset);
|
||||||
|
dataset.commit();
|
||||||
|
committed = true;
|
||||||
|
} finally {
|
||||||
|
if(!committed) {
|
||||||
|
dataset.abort();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
dataset.end();
|
dataset.end();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue