Abort TDB write transaction before ending if not successfully committed (#230)

This commit is contained in:
Brian Lowe 2021-06-02 18:55:23 +03:00 committed by GitHub
parent 1819fa1dd4
commit 3c04cc0f80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,9 +77,17 @@ public class RDFServiceTDB extends RDFServiceJena {
notifyListenersOfPreChangeEvents(changeSet); notifyListenersOfPreChangeEvents(changeSet);
dataset.begin(ReadWrite.WRITE); dataset.begin(ReadWrite.WRITE);
try {
boolean committed = false;
try { try {
applyChangeSetToModel(changeSet, dataset); applyChangeSetToModel(changeSet, dataset);
dataset.commit(); dataset.commit();
committed = true;
} finally {
if(!committed) {
dataset.abort();
}
}
} finally { } finally {
dataset.end(); dataset.end();
} }