From 29962d8fec699660ebded9fb8b550f1d74a89dbc 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 d759a65f..84f00559 100644 --- a/src/neo4j/exceptions.py +++ b/src/neo4j/exceptions.py @@ -608,6 +608,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. @@ -818,6 +824,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.