Skip to content

Commit d6668df

Browse files
authored
Docs: specify applicability of is_retryable (#1217)
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 9d0cec6 commit d6668df

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
@@ -656,6 +656,12 @@ def is_retryable(self) -> bool:
656656
retry. This method makes mostly sense when implementing a custom
657657
retry policy in conjunction with :ref:`explicit-transactions-ref`.
658658
659+
.. warning::
660+
661+
Auto-commit transactions
662+
(:meth:`.Session.run`/:meth:`.AsyncSession.run`) are not retryable
663+
regardless of this value.
664+
659665
:returns: :data:`True` if the error is retryable,
660666
:data:`False` otherwise.
661667
@@ -866,6 +872,12 @@ def is_retryable(self) -> bool:
866872
retry. This method makes mostly sense when implementing a custom
867873
retry policy in conjunction with :ref:`explicit-transactions-ref`.
868874
875+
.. warning::
876+
877+
Auto-commit transactions
878+
(:meth:`.Session.run`/:meth:`.AsyncSession.run`) are not retryable
879+
regardless of this value.
880+
869881
:returns: :data:`True` if the error is retryable,
870882
:data:`False` otherwise.
871883

0 commit comments

Comments
 (0)