Skip to content

Commit 343fb7b

Browse files
gjmwoodsdavidoliverSP2
authored andcommitted
Add Transaction Configuration section and Access Mode header
1 parent a8ded55 commit 343fb7b

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

modules/ROOT/pages/actions/index.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ There are several _actions_ that can be performed using the Cypher transaction H
1111
* xref:actions/query-format.adoc[]
1212
* xref:actions/result-format.adoc[]
1313
* xref:actions/routing.adoc[]
14+
* xref:actions/transaction-configuration.adoc[]
1415

1516
*Using the API:*
1617

modules/ROOT/pages/actions/routing.adoc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ The level of support depends on whether link:https://neo4j.com/docs/operations-m
1919
|Clusters support routing for queries that involve a xref::/actions/begin-and-commit-a-transaction-in-one-request.adoc[single request] (i.e. via the `tx/commit` endpoint).
2020
This is because the cluster does not currently support transaction identifiers across the cluster.
2121

22-
In this context, all queries are considered `WRITE` queries, even if they contain no cypher with write operations.
23-
Since the HTTP API did not previously support marking queries as `READ` or `WRITE`, the server assumes all queries are `WRITE` queries to support all cases.
24-
The effect of this is that all queries are ultimately executed on the leader.
25-
|===
22+
By default, all transactions are considered `WRITE` transactions, even if they contain no Cypher with write operations. This can be overridden by setting a value of `READ` in the `access-mode` header of the request (see xref::/actions/transaction-configuration.adoc[Transaction Configuration - Access Mode]).
23+
24+
This default has the effect that all queries are ultimately executed on the leader. To ensure efficient load balancing of `READ` transactions, you must label them as such in the request.
25+
|===
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[[http-api-actions-transaction-configuration]]
2+
3+
:description: Configuring HTTP Transactions.
4+
5+
6+
= Transaction Configuration
7+
8+
For any transaction initiating request (i.e. `/tx` or `tx/commit` ) you can provide configuration options that apply for the duration of the whole transaction.
9+
10+
== Access Mode
11+
To ensure that efficient load balancing across a cluster, it is important to label transactions that only contain `READ` statements with a `READ` access mode.
12+
13+
This can be done by adding an `access-mode` header to the request with a value of `READ`.
14+
15+
The default value if an `access-mode` configuration has not been provided is `WRITE` (expect for clusters where Server-side routing has been disabled where it is `READ`).

0 commit comments

Comments
 (0)