Skip to content

Commit 4ba3feb

Browse files
committed
docs: Update Driver#close() and Driver#closeAsync() documentation (neo4j#1634)
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 e80145b commit 4ba3feb

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
@@ -131,9 +131,9 @@ public interface Driver extends AutoCloseable {
131131
* <p>
132132
* This operation works the same way as {@link #closeAsync()} but blocks until all resources are closed.
133133
* <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.
134+
* Since this method is intended for graceful shutdown only, it is strongly recommended to finish interaction with
135+
* all driver resources (like sessions, transactions, results, etc.) before invoking this method. Not doing this may
136+
* result in unspecified behaviour, including leaving driver execution unfinished indefinitely.
137137
*/
138138
@Override
139139
void close();
@@ -144,9 +144,9 @@ public interface Driver extends AutoCloseable {
144144
* This operation is asynchronous and returns a {@link CompletionStage}. This stage is completed with
145145
* {@code null} when all resources are closed. It is completed exceptionally if termination fails.
146146
* <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.
147+
* Since this method is intended for graceful shutdown only, it is strongly recommended to finish interaction with
148+
* all driver resources (like sessions, transactions, results, etc.) before invoking this method. Not doing this may
149+
* result in unspecified behaviour, including leaving driver execution unfinished indefinitely.
150150
*
151151
* @return a {@link CompletionStage completion stage} that represents the asynchronous close.
152152
*/

0 commit comments

Comments
 (0)