Skip to content

Commit 03e1f57

Browse files
Fix minor Transactions page issues (#183)
* Fix Requirements client reference * Remove Java content * Fix Query Performance Advice section We're mentioning Java Reactive APIs in the shared partial, this doesn't apply to Node.js
1 parent 77c9337 commit 03e1f57

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

modules/howtos/pages/distributed-acid-transactions-from-the-sdk.adoc

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ include::project-docs:partial$attributes.adoc[]
1111

1212
include::{version-server}@sdk:shared:partial$acid-transactions.adoc[tag=intro]
1313

14-
You may also want to start with our https://github.com/couchbaselabs/couchbase-transactions-java-examples[transactions examples repository],
15-
which features useful downloadable examples of using Distributed Transactions.
16-
1714

1815
== Requirements
1916

2017
* Couchbase Server 6.6.1 or above.
21-
* Couchbase Node.js client 4.0.0 or above.
18+
* Couchbase Node.js SDK 4.0.0 or above.
2219
include::{version-server}@sdk:shared:partial$acid-transactions.adoc[tag=requirements]
2320

2421

@@ -111,7 +108,7 @@ It is provided as a convenience method so the developer does not have to check t
111108

112109
Gets will 'read your own writes', e.g. this will succeed:
113110

114-
[source,java]
111+
[source,typescript]
115112
----
116113
include::example$transactions-example.ts[tag=getReadOwnWrites,indent=0]
117114
----
@@ -146,7 +143,7 @@ include::example$transactions-example.ts[tag=queryExamplesUpdate,indent=0]
146143
----
147144

148145
And an example combining SELECTs and UPDATEs.
149-
It's possible to call regular Java methods from the lambda, as shown here, permitting complex logic to be performed.
146+
It's possible to call regular Node.js functions from the lambda, as shown here, permitting complex logic to be performed.
150147
Just remember that since the lambda may be called multiple times, so may the method.
151148

152149
[source,typescript]
@@ -192,7 +189,16 @@ include::{version-server}@sdk:shared:partial$acid-transactions.adoc[tag=query-op
192189
// TODO: this does not seem to exist for Node.js. should it?
193190
//See the xref:howtos:n1ql-queries-with-sdk.adoc#query-options[QueryOptions documentation] for details on these.
194191

195-
include::{version-server}@sdk:shared:partial$acid-transactions.adoc[tag=query-perf]
192+
// TODO: Replace the section below with this when we ensure that the shared partials in common are truly generic.
193+
// include::{version-server}@sdk:shared:partial$acid-transactions.adoc[tag=query-perf]
194+
=== Query Performance Advice
195+
This section is optional reading, and only for those looking to maximize transactions performance.
196+
197+
After the first query statement in a transaction, subsequent Key-Value operations in the lambda are converted into N1QL and executed by the query service rather than the Key-Value data service.
198+
The operation will behave identically, and this implementation detail can largely be ignored, except for these two caveats:
199+
200+
* These converted Key-Value operations are likely to be slightly slower, as the query service is optimised for statements involving multiple documents.
201+
Those looking for the maximum possible performance are recommended to put Key-Value operations before the first query in the lambda, if possible.
196202

197203
include::{version-server}@sdk:shared:partial$acid-transactions.adoc[tag=query-single]
198204

0 commit comments

Comments
 (0)