Skip to content

Commit 6978ae4

Browse files
committed
Add clarification to the driver close and closeAsync methods (neo4j#1537)
1 parent 6e60d83 commit 6978ae4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

driver/src/main/java/org/neo4j/driver/Driver.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ public interface Driver extends AutoCloseable {
130130
* Close all the resources assigned to this driver, including open connections and IO threads.
131131
* <p>
132132
* This operation works the same way as {@link #closeAsync()} but blocks until all resources are closed.
133+
* <p>
134+
* Please note that this method is intended for graceful shutdown only and expects that all driver interactions have
135+
* either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is
136+
* invoked.
133137
*/
134138
@Override
135139
void close();
@@ -139,6 +143,10 @@ public interface Driver extends AutoCloseable {
139143
* <p>
140144
* This operation is asynchronous and returns a {@link CompletionStage}. This stage is completed with
141145
* {@code null} when all resources are closed. It is completed exceptionally if termination fails.
146+
* <p>
147+
* Please note that this method is intended for graceful shutdown only and expects that all driver interactions have
148+
* either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is
149+
* invoked.
142150
*
143151
* @return a {@link CompletionStage completion stage} that represents the asynchronous close.
144152
*/

0 commit comments

Comments
 (0)