Skip to content

Commit 41ec710

Browse files
authored
Docs: specify applicability of is_retryable (#1218)
Because the server-side state of auto-commit transactions cannot be known by the driver (they might even be partially committed), it's not safe to retry them solely based on the exception observed. Business logic is required to determine if the auto-commit transaction succeeded or failed after observing an error client-side.
1 parent 6b15c21 commit 41ec710

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/neo4j/exceptions.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,12 @@ def is_retryable(self) -> bool:
782782
retry. This method makes mostly sense when implementing a custom
783783
retry policy in conjunction with :ref:`explicit-transactions-ref`.
784784
785+
.. warning::
786+
787+
Auto-commit transactions
788+
(:meth:`.Session.run`/:meth:`.AsyncSession.run`) are not retryable
789+
regardless of this value.
790+
785791
:returns: :data:`True` if the error is retryable,
786792
:data:`False` otherwise.
787793
@@ -1008,6 +1014,12 @@ def is_retryable(self) -> bool:
10081014
retry. This method makes mostly sense when implementing a custom
10091015
retry policy in conjunction with :ref:`explicit-transactions-ref`.
10101016
1017+
.. warning::
1018+
1019+
Auto-commit transactions
1020+
(:meth:`.Session.run`/:meth:`.AsyncSession.run`) are not retryable
1021+
regardless of this value.
1022+
10111023
:returns: :data:`True` if the error is retryable,
10121024
:data:`False` otherwise.
10131025

0 commit comments

Comments
 (0)