Skip to content

Commit 05c2358

Browse files
authored
added skipFastLockRound paramter to StreamTransactionOptions (#574)
1 parent 9fa5e7a commit 05c2358

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

core/src/main/java/com/arangodb/model/StreamTransactionOptions.java

+22
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public final class StreamTransactionOptions {
3636
private Boolean allowImplicit;
3737
@JsonIgnore
3838
private Boolean allowDirtyRead;
39+
private Boolean skipFastLockRound;
3940

4041
public StreamTransactionOptions() {
4142
super();
@@ -148,4 +149,25 @@ public StreamTransactionOptions allowDirtyRead(final Boolean allowDirtyRead) {
148149
return this;
149150
}
150151

152+
public Boolean getSkipFastLockRound() {
153+
return skipFastLockRound;
154+
}
155+
156+
/**
157+
* @param skipFastLockRound Whether to disable fast locking for write operations. Skipping the fast lock round can
158+
* be faster overall if there are many concurrent Stream Transactions queued that all try
159+
* to lock the same collection exclusively. It avoids deadlocking and retrying which can
160+
* occur with the fast locking by guaranteeing a deterministic locking order at the expense
161+
* of each actual locking operation taking longer.
162+
* Fast locking should not be skipped for read-only Stream Transactions because it degrades
163+
* performance if there are no concurrent transactions that use exclusive locks on the same
164+
* collection.
165+
* Default: {@code false}
166+
* @return options
167+
* @since ArangoDB 3.12.0
168+
*/
169+
public StreamTransactionOptions skipFastLockRound(final Boolean skipFastLockRound) {
170+
this.skipFastLockRound = skipFastLockRound;
171+
return this;
172+
}
151173
}

0 commit comments

Comments
 (0)