Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/ROOT/content-nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
** xref:actions/transaction-flow.adoc[]
** xref:actions/query-format.adoc[]
** xref:actions/result-format.adoc[]
** xref:actions/routing.adoc[]
** xref:actions/transaction-configuration.adoc[]
** xref:actions/begin-a-transaction.adoc[]
** xref:actions/execute-statements-in-an-open-transaction.adoc[]
** xref:actions/reset-transaction-timeout-of-an-open-transaction.adoc[]
Expand Down
1 change: 1 addition & 0 deletions modules/ROOT/pages/actions/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ There are several _actions_ that can be performed using the Cypher transaction H
* xref:actions/query-format.adoc[]
* xref:actions/result-format.adoc[]
* xref:actions/routing.adoc[]
* xref:actions/transaction-configuration.adoc[]

*Using the API:*

Expand Down
8 changes: 5 additions & 3 deletions modules/ROOT/pages/actions/routing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ The level of support depends on whether link:https://neo4j.com/docs/operations-m
|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).
This is because the cluster does not currently support transaction identifiers across the cluster.

In this context, all queries are considered `WRITE` queries, even if they contain no cypher with write operations.
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.
The effect of this is that all queries are ultimately executed on the leader.
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 (For more information, see xref::/actions/transaction-configuration.adoc[Transaction Configuration - Access Mode]).

This default value ensures that all queries are ultimately run on the leader.
To ensure efficient load balancing of `READ` transactions, you should label them as such in the request.
|===
18 changes: 18 additions & 0 deletions modules/ROOT/pages/actions/transaction-configuration.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:description: Configuring HTTP Transactions.

[[http-api-actions-transaction-configuration]]
= Transaction Configuration

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.

== Access Mode
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.

This can be done by adding an `access-mode` header to the request, with a value of `READ`.

[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`.
====