Skip to content

Commit

Permalink
#630 unlock if exception occurs
Browse files Browse the repository at this point in the history
Signed-off-by: Jeen Broekstra <jeen.broekstra@gmail.com>
  • Loading branch information
abrokenjester committed Oct 26, 2016
1 parent 41aa1ad commit 3c57552
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,14 +428,21 @@ public void deprecate(Resource subj, IRI pred, Value obj, Resource ctx)
private synchronized void acquireExclusiveTransactionLock()
throws SailException
{
boolean txnStarted = false;
if (!txnLockManager.isHeldByCurrentThread()) {
try {
txnLockManager.lock();
tripleStore.startTransaction();
txnStarted = true;
}
catch (IOException e) {
throw new SailException(e);
}
finally {
if (!txnStarted) {
txnLockManager.unlock();
}
}
}
}

Expand Down

0 comments on commit 3c57552

Please sign in to comment.