Skip to content

Commit 4e0dd41

Browse files
committed
Updates
1 parent 32ada54 commit 4e0dd41

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/main/java/com/experoinc/janusgraph/diskstorage/foundationdb/FoundationDBTx.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.experoinc.janusgraph.diskstorage.foundationdb;
22

33
import com.apple.foundationdb.Database;
4-
import com.apple.foundationdb.FDBException;
54
import com.apple.foundationdb.KeyValue;
65
import com.apple.foundationdb.Range;
76
import com.apple.foundationdb.Transaction;
@@ -62,13 +61,16 @@ public FoundationDBTx(Database db, Transaction t, BaseTransactionConfig config,
6261
}
6362
}
6463

65-
private Object resetLock = new Object();
66-
6764
public synchronized void restart() {
6865
txId.incrementAndGet();
6966
if (tx == null) return;
70-
tx.cancel();
71-
tx.close();
67+
try {
68+
tx.cancel();
69+
} catch (IllegalStateException e) {
70+
//
71+
} finally {
72+
tx.close();
73+
}
7274
tx = db.createTransaction();
7375
// Reapply mutations but do not clear them out just in case this transaction also
7476
// times out and they need to be reapplied.
@@ -116,17 +118,13 @@ public synchronized void commit() throws BackendException {
116118
tx = null;
117119
failing = false;
118120
break;
119-
} catch (ExecutionException e) {
121+
} catch (IllegalStateException | ExecutionException e) {
120122
if (isolationLevel.equals(IsolationLevel.READ_COMMITTED_NO_WRITE)) {
121123
break;
122124
}
123125
restart();
124126
} catch (Exception e) {
125127
throw new PermanentBackendException(e);
126-
} finally {
127-
if (tx != null) {
128-
tx.close();
129-
}
130128
}
131129
}
132130
if (failing) {

0 commit comments

Comments
 (0)