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,9 +77,17 @@ public class RDFServiceTDB extends RDFServiceJena {
|
|||
notifyListenersOfPreChangeEvents(changeSet);
|
||||
|
||||
dataset.begin(ReadWrite.WRITE);
|
||||
try {
|
||||
boolean committed = false;
|
||||
try {
|
||||
applyChangeSetToModel(changeSet, dataset);
|
||||
dataset.commit();
|
||||
committed = true;
|
||||
} finally {
|
||||
if(!committed) {
|
||||
dataset.abort();
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
dataset.end();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue