From 8229fdf3f4b384a41d51df223f49caefd3d2eca7 Mon Sep 17 00:00:00 2001 From: Gregory Woods Date: Wed, 20 Apr 2022 11:41:32 +0100 Subject: [PATCH 1/2] Add example for access-mode header --- .../actions/transaction-configuration.adoc | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/modules/ROOT/pages/actions/transaction-configuration.adoc b/modules/ROOT/pages/actions/transaction-configuration.adoc index 047486a..dd66910 100644 --- a/modules/ROOT/pages/actions/transaction-configuration.adoc +++ b/modules/ROOT/pages/actions/transaction-configuration.adoc @@ -19,3 +19,44 @@ If an `access-mode` configuration has *not* been provided, the default value is However, if you have clusters with link:https://neo4j.com/docs/operations-manual/current/clustering/internals/#clustering-routing[Server-side routing] disabled, the default value is `READ`. ==== + +_Example request_ + +* *+POST+* +http://localhost:7474/db/neo4j/tx/commit+ +* *+Accept:+* +application/json;charset=UTF-8+ +* *+Content-Type:+* +application/json+ +* *+Access-Mode:+* +WRITE+ + +[source, JSON, role="nocopy"] +---- +{ + "statements": [ + { + "statement": "CREATE (n) RETURN n" + } + ] +} +---- + +_Example response_ + +* *+200:+* +OK+ +* *+Content-Type:+* +application/json;charset=utf-8+ + +[source, JSON, role="nocopy"] +---- +{ + "results" : [ { + "columns" : [ "n" ], + "data" : [ { + "row" : [ { } ], + "meta" : [ { + "id" : 7, + "type" : "node", + "deleted" : false + } ] + } ] + } ], + "errors" : [ ] +} +---- \ No newline at end of file From 3d03a55464108410851971e29032273803bbebd4 Mon Sep 17 00:00:00 2001 From: David Oliver Date: Wed, 20 Apr 2022 14:05:42 +0100 Subject: [PATCH 2/2] Update link to SSR and add note clarifying single instance --- .../pages/actions/transaction-configuration.adoc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/actions/transaction-configuration.adoc b/modules/ROOT/pages/actions/transaction-configuration.adoc index dd66910..9e29d3e 100644 --- a/modules/ROOT/pages/actions/transaction-configuration.adoc +++ b/modules/ROOT/pages/actions/transaction-configuration.adoc @@ -5,19 +5,26 @@ For any transaction-initiating request (such as `/tx` or `tx/commit`), you can provide configuration options that apply for the duration of the whole transaction. + +[[http-api-actions-access-mode]] == Access Mode To ensure efficient load balancing across a cluster, it is important to label transactions that only contain `READ` statements with a `READ` access mode. This can be done by adding an `access-mode` header to the request, with a value of `READ`. -This feature was introduced in Neo4j version 4.4.4. [WARNING] ==== If an `access-mode` configuration has *not* been provided, the default value is `WRITE`. -However, if you have clusters with link:https://neo4j.com/docs/operations-manual/current/clustering/internals/#clustering-routing[Server-side routing] disabled, the default value is `READ`. +However, if you have clusters with link:https://neo4j.com/docs/operations-manual/current/clustering/internals/#causal-clustering-routing[Server-side routing] disabled, the default value is `READ`. +==== + +[NOTE] +==== +* Please note that `access-mode` is not required for a Neo4j single instance. +* This feature was introduced in Neo4j version 4.4.4. ==== _Example request_ @@ -59,4 +66,4 @@ _Example response_ } ], "errors" : [ ] } ----- \ No newline at end of file +----