Skip to content

Commit 285f71d

Browse files
committed
Touch
1 parent bed635a commit 285f71d

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

pages/help-center/errors/transactions.mdx

+19-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Transactions
3-
description: Learn about transaction errors that can occur in Memgraph and what to do when you encounter them.
3+
description: Learn about transaction errors that can occur in Memgraph and what to do when you encounter them.
44
---
55

66
import { Callout } from 'nextra/components'
@@ -23,15 +23,15 @@ While working with Memgraph, you can encounter various transaction errors. Here
2323

2424
### Handling conflicting transaction and serialization error
2525

26-
Conflicting transactions and serialization errors are, in a sense, the same error that usually occurs when concurrent data
27-
imports and transactions try to work on the same data points simultaneously. This situation can occur in both testing
28-
and production environments. It's important that your code anticipates and handles these errors.
26+
Conflicting transactions and serialization errors are, in a sense, the same error that usually occurs when concurrent data
27+
imports and transactions try to work on the same data points simultaneously. This situation can occur in both testing
28+
and production environments. It's important that your code anticipates and handles these errors.
2929

3030
A common scenario that triggers an error is when two nodes in a graph are being updated by two
31-
different transactions attempting to add relationships between them at the same moment, changing a property, label, etc.
31+
different transactions attempting to add relationships between them at the same moment, changing a property, label, etc.
3232
The same applies to relationships as well. In essence, it is a write-write conflict.
33-
For example, if both transactions try to add a relationship at the same time to
34-
an identical node, the error will happen.
33+
For example, if both transactions try to add a relationship at the same time to
34+
an identical node, the error will happen.
3535

3636
To address these problems, consider the following strategies:
3737

@@ -52,7 +52,7 @@ To address these problems, consider the following strategies:
5252
tx.commit()
5353
break
5454
except TransientError as te:
55-
jitter = random.uniform(0, jitter) * initial_wait_time
55+
jitter = random.uniform(0, jitter) * initial_wait_time
5656
wait_time = initial_wait_time * (backoff_factor ** attempt) + jitter
5757
print(f"Commit failed on attempt {attempt+1}. Retrying in {wait_time} seconds...")
5858
time.sleep(wait_time)
@@ -62,12 +62,12 @@ To address these problems, consider the following strategies:
6262
raise e
6363
```
6464

65-
Keep in mind that adjusting the `max_retries`, `initial_wait_time`, `backoff_factor`, and `jitter` is important to avoid overloading the system with retries.
65+
Keep in mind that adjusting the `max_retries`, `initial_wait_time`, `backoff_factor`, and `jitter` is important to avoid overloading the system with retries.
6666
For more information on how to handle retries and adjust parameters, please refer to the respective [client documentation](../../client-libraries.mdx) since examples will vary based on different clients.
6767

68-
- **Understand the client you are using:**
69-
Neo4j clients in managed transactions have built-in logic to retry transactions that fail due to
70-
serialization errors automatically. Typically, a timeout is associated with these retries, after which
68+
- **Understand the client you are using:**
69+
Neo4j clients in managed transactions have built-in logic to retry transactions that fail due to
70+
serialization errors automatically. Typically, a timeout is associated with these retries, after which
7171
the client will forward the error to the application code. Developers must be
7272
aware of this and implement additional error handling as required.
7373

@@ -87,17 +87,17 @@ To address these problems, consider the following strategies:
8787
- **Avoid conflicts**: This can be done by
8888
implementing application-level logic to prevent concurrent transactions from
8989
modifying the same data points. This strategy can significantly reduce the
90-
likelihood of encountering errors. It will also lead to better performance
91-
since the system is not spending time resolving conflict.
90+
likelihood of encountering errors. It will also lead to better performance
91+
since the system is not spending time resolving conflict.
9292

9393
Handling serialization errors effectively is essential for maintaining a smooth
9494
user experience and ensuring the reliability of your application. Implementing
9595
robust error handling and conflict avoidance mechanisms can mitigate the impact
9696
of these errors.
9797

98-
While some client drivers may handle serialization errors by retrying transactions,
99-
developers should not rely solely on this mechanism. Always include comprehensive error handling
100-
in your application to address cases where the error persists beyond the retry logic.
98+
While some client drivers may handle serialization errors by retrying transactions,
99+
developers should not rely solely on this mechanism. Always include comprehensive error handling
100+
in your application to address cases where the error persists beyond the retry logic.
101101

102102

103103
## Transaction timeout
@@ -111,14 +111,15 @@ in your application to address cases where the error persists beyond the retry l
111111
The transaction that is running exceeds the query execution timeout that is set in the Memgraph configuration to 600 seconds by default.
112112
To change that, update the flag `--query-execution-timeout-sec` value to a value that is large enough to handle the transaction (query) you're running or set it to 0 for no limit.
113113

114-
Here are the [instructions](/configuration/configuration-settings#using-flags-and-config-file) on how to update the configuration.
114+
Here are the [instructions](/configuration/configuration-settings#using-flags-and-config-file) on how to update the configuration.
115115

116116
## Storage access timeout
117117

118118
### Error messages
119119

120120
Here are the storage access error messages you might encounter:
121121

122+
# TODO Update access types
122123
1. **Cannot access storage, unique access query is running. Try again later.**
123124
2. **Cannot get unique access to the storage. Try stopping other queries that are running in parallel.**
124125

0 commit comments

Comments
 (0)