Skip to content

Commit 86d367f

Browse files
authored
Merge pull request #119 from loveleif/cypher-lost-updates
Clarify documentation around lost Cypher updates
2 parents 57fdde0 + b6a8089 commit 86d367f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

modules/ROOT/pages/transaction-management.adoc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,7 @@ Due to the limitations of the _read-committed isolation level_, the increments m
8282
If there is a direct dependency, Cypher automatically acquires a write lock before reading.
8383
A direct dependency is when the right-hand side of `SET` has a dependent property read in the expression or the value of a key-value pair in a literal map.
8484

85-
For example, if you run the following query by one hundred concurrent clients, it is very likely not to increment the property `n.prop` to 100, unless a write lock is acquired before reading the property value.
86-
This is because all queries read the value of `n.prop` within their own transaction, and cannot see the incremented value from any other transaction that has not yet been committed.
87-
In the worst case scenario, the final value would be as low as 1 if all threads perform the read before any has committed their transaction.
85+
For example, if you run one of the following queries by one hundred concurrent clients, it will increment the property `n.prop` to 100 because Cypher will automatically acquire a write lock.
8886

8987
.Cypher can acquire a write lock
9088
====
@@ -108,7 +106,8 @@ SET n += {prop: n.prop + 1}
108106
----
109107
====
110108

111-
Due to the complexity of determining such a dependency in the general case, Cypher does not cover any of the following example cases:
109+
Due to the complexity of determining such a dependency in the general case, Cypher does not cover all cases.
110+
If you run one of the following queries concurrently 100 times, the final value of `n.prop` will most probably be less than 100.
112111

113112
.Complex Cypher
114113
====

0 commit comments

Comments
 (0)