Skip to content

Commit c7b54d8

Browse files
committed
docs: Update Driver#close() and Driver#closeAsync() documentation
The objective is to improve `Driver#close()` and `Driver#closeAsync()` methods documentation and to emphasise that it should be called only when all driver interactions are finished.
1 parent 61e99b3 commit c7b54d8

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,9 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
335335
* <p>
336336
* This operation works the same way as {@link #closeAsync()} but blocks until all resources are closed.
337337
* <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.
338+
* Since this method is intended for graceful shutdown only, it is strongly recommended to finish interaction with
339+
* all driver resources (like sessions, transactions, results, etc.) before invoking this method. Not doing this may
340+
* result in unspecified behaviour, including leaving driver execution unfinished indefinitely.
341341
*/
342342
@Override
343343
void close();
@@ -348,9 +348,9 @@ default AsyncSession asyncSession(SessionConfig sessionConfig) {
348348
* This operation is asynchronous and returns a {@link CompletionStage}. This stage is completed with
349349
* {@code null} when all resources are closed. It is completed exceptionally if termination fails.
350350
* <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.
351+
* Since this method is intended for graceful shutdown only, it is strongly recommended to finish interaction with
352+
* all driver resources (like sessions, transactions, results, etc.) before invoking this method. Not doing this may
353+
* result in unspecified behaviour, including leaving driver execution unfinished indefinitely.
354354
*
355355
* @return a {@link CompletionStage completion stage} that represents the asynchronous close.
356356
*/

0 commit comments

Comments
 (0)