Skip to content

Commit 1482cbd

Browse files
committed
Add clarification to the driver close and closeAsync methods
1 parent 147305e commit 1482cbd

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
@@ -334,6 +334,10 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
334334
* Close all the resources assigned to this driver, including open connections and IO threads.
335335
* <p>
336336
* This operation works the same way as {@link #closeAsync()} but blocks until all resources are closed.
337+
* <p>
338+
* Please note that this method is intended for graceful shutdown only and expects that all driver interactions have
339+
* either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is
340+
* invoked.
337341
*/
338342
@Override
339343
void close();
@@ -343,6 +347,10 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
343347
* <p>
344348
* This operation is asynchronous and returns a {@link CompletionStage}. This stage is completed with
345349
* {@code null} when all resources are closed. It is completed exceptionally if termination fails.
350+
* <p>
351+
* Please note that this method is intended for graceful shutdown only and expects that all driver interactions have
352+
* either been finished or no longer awaited for. Pending driver API calls may not be completed after this method is
353+
* invoked.
346354
*
347355
* @return a {@link CompletionStage completion stage} that represents the asynchronous close.
348356
*/

0 commit comments

Comments
 (0)