From 6ba361f8f3aad739bde4204bc171c990008c0c0e Mon Sep 17 00:00:00 2001 From: Robsdedude Date: Wed, 26 Mar 2025 09:09:50 +0100 Subject: [PATCH] API docs: Driver.close is not concurrency-safe --- neo4j/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/neo4j/__init__.py b/neo4j/__init__.py index 90774427d..f4c056169 100644 --- a/neo4j/__init__.py +++ b/neo4j/__init__.py @@ -314,6 +314,13 @@ def pipeline(self, **config): def close(self): """ Shut down, closing any open connections in the pool. + + .. warning:: + + While the driver object is concurrency-safe, ``close`` is *not*. + Make sure you are not using the driver object or any resources + spawned from it (such as sessions or transactions) while calling + this method. Failing to do so results in unspecified behavior. """ self._pool.close()