From 5fecc3ed51d30eb599e698270387263c5c902820 Mon Sep 17 00:00:00 2001 From: Dmitriy Tverdiakov <11927660+injectives@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:54:25 +0000 Subject: [PATCH] Add clarification to the driver close and closeAsync methods (#1537) (#1541) --- driver/src/main/java/org/neo4j/driver/Driver.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/driver/src/main/java/org/neo4j/driver/Driver.java b/driver/src/main/java/org/neo4j/driver/Driver.java index 0861ed5c03..b8f6dc2b17 100644 --- a/driver/src/main/java/org/neo4j/driver/Driver.java +++ b/driver/src/main/java/org/neo4j/driver/Driver.java @@ -130,6 +130,10 @@ public interface Driver extends AutoCloseable { * Close all the resources assigned to this driver, including open connections and IO threads. *

* This operation works the same way as {@link #closeAsync()} but blocks until all resources are closed. + *

+ * Please note that this method is intended for graceful shutdown only and expects that all driver interactions have + * either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is + * invoked. */ @Override void close(); @@ -139,6 +143,10 @@ public interface Driver extends AutoCloseable { *

* This operation is asynchronous and returns a {@link CompletionStage}. This stage is completed with * {@code null} when all resources are closed. It is completed exceptionally if termination fails. + *

+ * Please note that this method is intended for graceful shutdown only and expects that all driver interactions have + * either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is + * invoked. * * @return a {@link CompletionStage completion stage} that represents the asynchronous close. */