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
|
@ -76,11 +76,19 @@ public class RDFServiceTDB extends RDFServiceJena {
|
|||
}
|
||||
notifyListenersOfPreChangeEvents(changeSet);
|
||||
|
||||
dataset.begin(ReadWrite.WRITE);
|
||||
try {
|
||||
applyChangeSetToModel(changeSet, dataset);
|
||||
dataset.commit();
|
||||
} finally {
|
||||
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
Add a link
Reference in a new issue