From f3f3bef315ca94c779676361f65cb9c80c7db38d Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Tue, 15 Jul 2025 10:57:11 +0200 Subject: [PATCH] Docs: specify applicability of `is_retryable` 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. --- src/neo4j/exceptions.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/neo4j/exceptions.py b/src/neo4j/exceptions.py index affca2794..6d07fe058 100644 --- a/src/neo4j/exceptions.py +++ b/src/neo4j/exceptions.py @@ -782,6 +782,12 @@ def is_retryable(self) -> bool: retry. This method makes mostly sense when implementing a custom retry policy in conjunction with :ref:`explicit-transactions-ref`. + .. warning:: + + Auto-commit transactions + (:meth:`.Session.run`/:meth:`.AsyncSession.run`) are not retryable + regardless of this value. + :returns: :data:`True` if the error is retryable, :data:`False` otherwise. @@ -1008,6 +1014,12 @@ def is_retryable(self) -> bool: retry. This method makes mostly sense when implementing a custom retry policy in conjunction with :ref:`explicit-transactions-ref`. + .. warning:: + + Auto-commit transactions + (:meth:`.Session.run`/:meth:`.AsyncSession.run`) are not retryable + regardless of this value. + :returns: :data:`True` if the error is retryable, :data:`False` otherwise.