You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -216,6 +260,44 @@ public Builder withBookmarkManager(BookmarkManager bookmarkManager) {
216
260
returnthis;
217
261
}
218
262
263
+
/**
264
+
* Set the transaction timeout. Transactions that execute longer than the configured timeout will be terminated by the database.
265
+
* <p>
266
+
* This functionality allows user code to limit query/transaction execution time.
267
+
* The specified timeout overrides the default timeout configured in the database using the {@code db.transaction.timeout} setting ({@code dbms.transaction.timeout} before Neo4j 5.0).
268
+
* Values higher than {@code db.transaction.timeout} will be ignored and will fall back to the default for server versions between 4.2 and 5.2 (inclusive).
269
+
* <p>
270
+
* The provided value should not represent a negative duration.
271
+
* {@link Duration#ZERO} will make the transaction execute indefinitely.
272
+
*
273
+
* @param timeout the timeout.
274
+
* @return this builder.
275
+
* @since 5.15
276
+
*/
277
+
publicBuilderwithTimeout(Durationtimeout) {
278
+
if (timeout != null) {
279
+
checkArgument(!timeout.isNegative(), "Transaction timeout should not be negative");
280
+
}
281
+
282
+
this.timeout = timeout;
283
+
returnthis;
284
+
}
285
+
286
+
/**
287
+
* Set the transaction metadata.
288
+
*
289
+
* @param metadata the metadata, must not be {@code null}.
0 commit comments