diff --git a/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java b/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java index 7eea48514..bd78d6c4f 100644 --- a/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java +++ b/core/src/main/java/com/arangodb/model/StreamTransactionOptions.java @@ -36,6 +36,7 @@ public final class StreamTransactionOptions { private Boolean allowImplicit; @JsonIgnore private Boolean allowDirtyRead; + private Boolean skipFastLockRound; public StreamTransactionOptions() { super(); @@ -148,4 +149,25 @@ public StreamTransactionOptions allowDirtyRead(final Boolean allowDirtyRead) { return this; } + public Boolean getSkipFastLockRound() { + return skipFastLockRound; + } + + /** + * @param skipFastLockRound Whether to disable fast locking for write operations. Skipping the fast lock round can + * be faster overall if there are many concurrent Stream Transactions queued that all try + * to lock the same collection exclusively. It avoids deadlocking and retrying which can + * occur with the fast locking by guaranteeing a deterministic locking order at the expense + * of each actual locking operation taking longer. + * Fast locking should not be skipped for read-only Stream Transactions because it degrades + * performance if there are no concurrent transactions that use exclusive locks on the same + * collection. + * Default: {@code false} + * @return options + * @since ArangoDB 3.12.0 + */ + public StreamTransactionOptions skipFastLockRound(final Boolean skipFastLockRound) { + this.skipFastLockRound = skipFastLockRound; + return this; + } }