From 79f2ce2e8c598901a5cda85d142fd6d6520f701c Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Mon, 25 Sep 2023 12:41:15 +0200 Subject: [PATCH] Improve transaction timeout docs (#1486) The timeout behaves differently on different server versions in respects to the user being or not being able to overwrite the server timeout with a bigger value. Also make sure the docs mention special values like `Duration.ZERO`. --- .../src/main/java/org/neo4j/driver/TransactionConfig.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/driver/src/main/java/org/neo4j/driver/TransactionConfig.java b/driver/src/main/java/org/neo4j/driver/TransactionConfig.java index 6024ff57a7..896fec2962 100644 --- a/driver/src/main/java/org/neo4j/driver/TransactionConfig.java +++ b/driver/src/main/java/org/neo4j/driver/TransactionConfig.java @@ -174,10 +174,12 @@ private Builder() {} * Set the transaction timeout. Transactions that execute longer than the configured timeout will be terminated by the database. * See also {@link #withDefaultTimeout}. *

- * This functionality allows to limit query/transaction execution time. Specified timeout overrides the default timeout configured in the database - * using {@code dbms.transaction.timeout} setting. + * This functionality allows to limit query/transaction execution time. + * 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). + * Values higher than {@code db.transaction.timeout} will be ignored and will fall back to the default for server versions 4.2 to including 5.2. *

- * Provided value should not represent a negative duration. + * The provided value should not represent a negative duration. + * {@link Duration#ZERO} will make the transaction execute indefinitely. * * @param timeout the timeout. * @return this builder.