From 565c48a3ede67a590a225bd3cf77eeeb6dc2d953 Mon Sep 17 00:00:00 2001 From: Love Leifland Date: Mon, 1 Dec 2025 15:13:05 +0100 Subject: [PATCH 1/9] Document Cypher Shell --transaction-timeout --- modules/ROOT/pages/cypher-shell.adoc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index 7dd98434e..95f471701 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -19,13 +19,15 @@ Alternatively, you can download it from link:https://neo4j.com/deployment-center The syntax for running Cypher Shell is: ---- -cypher-shell [-h] [-a ADDRESS] [-u USERNAME] [--impersonate IMPERSONATE] [-p PASSWORD] +usage: cypher-shell [-h] [-a ADDRESS] [-u USERNAME] [--impersonate IMPERSONATE] [-p PASSWORD] [--encryption {true,false,default}] [-d DATABASE] [--access-mode {read,write}] [--enable-autocompletions] [--format {auto,verbose,plain}] [-P PARAM] [--non-interactive] [--sample-rows SAMPLE-ROWS] [--wrap {true,false}] [-v] [--driver-version] [-f FILE] [--change-password] [--log [LOG-FILE]] [--history HISTORY-BEHAVIOUR] [--notifications] [--idle-timeout IDLE-TIMEOUT] - [--error-format {gql,legacy,stacktrace}] [--fail-fast | --fail-at-end] [cypher] + [--error-format {gql,legacy,stacktrace}] + [--transaction-timeout TRANSACTION-TIMEOUT] [--fail-fast | --fail-at-end] + [cypher] ---- == Positional arguments @@ -123,6 +125,10 @@ Can also be set using the environment variable `NEO4J_CYPHER_SHELL_HISTORY`. |--error-format {gql,legacy,stacktrace} |Controls how errors are displayed. |gql label:new[Changed in 2025.06] + +|--transaction-timeout {gql,legacy,stacktrace} +|Transaction timeout. You can specify the duration using the format `hms`, for example `1h` (1 hour), `1h30m` (1 hour 30 minutes), or `30m` (30 minutes). +|disable label:new[Changed in 2026.01] |=== == Connection arguments From d7f22ba347f085c501bf2cdcb8facb5a81920eba Mon Sep 17 00:00:00 2001 From: Love Leifland Date: Mon, 1 Dec 2025 15:15:03 +0100 Subject: [PATCH 2/9] Fix --- modules/ROOT/pages/cypher-shell.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index 95f471701..ebcdcab29 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -19,7 +19,7 @@ Alternatively, you can download it from link:https://neo4j.com/deployment-center The syntax for running Cypher Shell is: ---- -usage: cypher-shell [-h] [-a ADDRESS] [-u USERNAME] [--impersonate IMPERSONATE] [-p PASSWORD] +cypher-shell [-h] [-a ADDRESS] [-u USERNAME] [--impersonate IMPERSONATE] [-p PASSWORD] [--encryption {true,false,default}] [-d DATABASE] [--access-mode {read,write}] [--enable-autocompletions] [--format {auto,verbose,plain}] [-P PARAM] [--non-interactive] [--sample-rows SAMPLE-ROWS] [--wrap {true,false}] [-v] From 3b07119ff123249539e6d6d505be8cde17ba3c15 Mon Sep 17 00:00:00 2001 From: Love Leifland Date: Mon, 1 Dec 2025 15:15:44 +0100 Subject: [PATCH 3/9] Fix --- modules/ROOT/pages/cypher-shell.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index ebcdcab29..aa2600f2b 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -126,7 +126,7 @@ Can also be set using the environment variable `NEO4J_CYPHER_SHELL_HISTORY`. |Controls how errors are displayed. |gql label:new[Changed in 2025.06] -|--transaction-timeout {gql,legacy,stacktrace} +|--transaction-timeout TRANSACTION-TIMEOUT |Transaction timeout. You can specify the duration using the format `hms`, for example `1h` (1 hour), `1h30m` (1 hour 30 minutes), or `30m` (30 minutes). |disable label:new[Changed in 2026.01] |=== From 366d6541eb05623e80a125305ef29aa1e9c7be44 Mon Sep 17 00:00:00 2001 From: Love Leifland Date: Wed, 3 Dec 2025 06:33:58 +0100 Subject: [PATCH 4/9] Add example --- modules/ROOT/pages/cypher-shell.adoc | 30 ++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index aa2600f2b..314f68c78 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -598,6 +598,36 @@ CALL dbms.showCurrentUser(); ---- ==== +[[cypher-shell-transaction-timeout]] +== Transaction Timeout + +You can start Cypher Shell with a specific transaction timeout which will apply to all transactions during the session. + +.Start with transaction timeout argument +==== + +[source, shell] +---- +cypher-shell --transaction-timeout 10m +---- + +Execute a very long running query. + +[source, shell] +---- +UNWIND range(0, 90_000) AS x +CALL apoc.util.sleep(100) +RETURN sum(x) AS sum; +---- + +After ~10 minutes have passed the transaction times out + +[queryresult] +---- +25N14: invalid transaction state - transaction termination client error. The transaction has been terminated. Retry your operation in a new transaction, and you should see a successful result. Reason: The transaction has not completed within the timeout specified at its start by the client. You may want to retry with a longer timeout. +---- +==== + [[cypher-shell-support]] == Supported operating systems From ce81b770b50605e15fe3c13d44554aee7b9bd75d Mon Sep 17 00:00:00 2001 From: Love Leifland Date: Wed, 3 Dec 2025 06:42:13 +0100 Subject: [PATCH 5/9] Remove label --- modules/ROOT/pages/cypher-shell.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index 314f68c78..097bbb75f 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -128,7 +128,7 @@ Can also be set using the environment variable `NEO4J_CYPHER_SHELL_HISTORY`. |--transaction-timeout TRANSACTION-TIMEOUT |Transaction timeout. You can specify the duration using the format `hms`, for example `1h` (1 hour), `1h30m` (1 hour 30 minutes), or `30m` (30 minutes). -|disable label:new[Changed in 2026.01] +|disable |=== == Connection arguments From 46b293a3df552a974ce64c0a43509af14a11cfd0 Mon Sep 17 00:00:00 2001 From: Love Leifland Date: Wed, 3 Dec 2025 06:43:43 +0100 Subject: [PATCH 6/9] Move section --- modules/ROOT/pages/cypher-shell.adoc | 53 ++++++++++++++-------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index 097bbb75f..901cb5e97 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -573,31 +573,6 @@ ready to start consuming query after 1 ms, results consumed after another 1 ms ---- ==== -[[cypher-shell-procedures]] -== Procedures - -Cypher Shell supports running any procedures for which the current user is authorized. - -.Call the `dbms.showCurrentUser` procedure -==== - -[source, shell] ----- -CALL dbms.showCurrentUser(); ----- - -[queryresult] ----- -+------------------------------+ -| username | roles | flags | -+------------------------------+ -| "neo4j" | ["admin"] | [] | -+------------------------------+ - -1 row available after 66 ms, consumed after another 2 ms ----- -==== - [[cypher-shell-transaction-timeout]] == Transaction Timeout @@ -620,7 +595,7 @@ CALL apoc.util.sleep(100) RETURN sum(x) AS sum; ---- -After ~10 minutes have passed the transaction times out +After ~10 minutes have passed the transaction times out. [queryresult] ---- @@ -629,6 +604,32 @@ After ~10 minutes have passed the transaction times out ==== +[[cypher-shell-procedures]] +== Procedures + +Cypher Shell supports running any procedures for which the current user is authorized. + +.Call the `dbms.showCurrentUser` procedure +==== + +[source, shell] +---- +CALL dbms.showCurrentUser(); +---- + +[queryresult] +---- ++------------------------------+ +| username | roles | flags | ++------------------------------+ +| "neo4j" | ["admin"] | [] | ++------------------------------+ + +1 row available after 66 ms, consumed after another 2 ms +---- +==== + + [[cypher-shell-support]] == Supported operating systems From 7477579fb50d58a65d142603d6a4b73e58a30b0e Mon Sep 17 00:00:00 2001 From: Love Kristofer Leifland Date: Wed, 3 Dec 2025 16:05:51 +0100 Subject: [PATCH 7/9] Update modules/ROOT/pages/cypher-shell.adoc Co-authored-by: Reneta Popova --- modules/ROOT/pages/cypher-shell.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index 901cb5e97..5f6a80187 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -576,7 +576,7 @@ ready to start consuming query after 1 ms, results consumed after another 1 ms [[cypher-shell-transaction-timeout]] == Transaction Timeout -You can start Cypher Shell with a specific transaction timeout which will apply to all transactions during the session. +You can start Cypher Shell with a specific transaction timeout, which will apply to all transactions during the session. .Start with transaction timeout argument ==== From 36d6d2727d66571d415145b2f3aeeeb5b82a65bd Mon Sep 17 00:00:00 2001 From: Love Kristofer Leifland Date: Wed, 3 Dec 2025 16:06:08 +0100 Subject: [PATCH 8/9] Update modules/ROOT/pages/cypher-shell.adoc Co-authored-by: Reneta Popova --- modules/ROOT/pages/cypher-shell.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index 5f6a80187..f717470e7 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -583,7 +583,7 @@ You can start Cypher Shell with a specific transaction timeout, which will apply [source, shell] ---- -cypher-shell --transaction-timeout 10m +bin/cypher-shell -u neo4j -p --transaction-timeout 10m ---- Execute a very long running query. From d89b8cc3c875cfc13aa6db08a528d95e16ddbc1d Mon Sep 17 00:00:00 2001 From: Love Kristofer Leifland Date: Wed, 3 Dec 2025 16:06:23 +0100 Subject: [PATCH 9/9] Update modules/ROOT/pages/cypher-shell.adoc Co-authored-by: Reneta Popova --- modules/ROOT/pages/cypher-shell.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/cypher-shell.adoc b/modules/ROOT/pages/cypher-shell.adoc index f717470e7..9c6e3908e 100644 --- a/modules/ROOT/pages/cypher-shell.adoc +++ b/modules/ROOT/pages/cypher-shell.adoc @@ -595,7 +595,7 @@ CALL apoc.util.sleep(100) RETURN sum(x) AS sum; ---- -After ~10 minutes have passed the transaction times out. +After ~10 minutes, the transaction times out. [queryresult] ----