NetworkSession { public CompletionStage<Void> closeAsync() { if ( open.compareAndSet( true, false ) ) { return resultCursorStage.thenCompose( cursor -> { if ( cursor != null ) { return cursor.discardAllFailureAsync(); } return completedWithNull(); } ).thenCompose( cursorError -> closeTransactionAndReleaseConnection().thenApply( txCloseError -> { CompletionException combinedError = Futures.combineErrors( cursorError, txCloseError ); if ( combinedError != null ) { throw combinedError; } return null; } ) ); } return completedWithNull(); } NetworkSession( ConnectionProvider connectionProvider, RetryLogic retryLogic, DatabaseName databaseName, AccessMode mode,
            BookmarkHolder bookmarkHolder, long fetchSize, Logging logging ); CompletionStage<ResultCursor> runAsync(Query query, TransactionConfig config, boolean waitForRunResponse ); CompletionStage<RxResultCursor> runRx(Query query, TransactionConfig config ); CompletionStage<UnmanagedTransaction> beginTransactionAsync( TransactionConfig config ); CompletionStage<UnmanagedTransaction> beginTransactionAsync( AccessMode mode, TransactionConfig config ); CompletionStage<Void> resetAsync(); RetryLogic retryLogic(); Bookmark lastBookmark(); CompletionStage<Void> releaseConnectionAsync(); CompletionStage<Connection> connectionAsync(); boolean isOpen(); CompletionStage<Void> closeAsync();  }
@Test void shouldBeAbleToOpenTxAfterPreviousIsClosed() { await( beginTransaction( session ).closeAsync() ); UnmanagedTransaction tx = beginTransaction( session ); assertNotNull( tx ); verifyRollbackTx( connection ); }
@Test void shouldBeAbleToUseSessionAgainWhenTransactionIsClosed() { await ( beginTransaction( session ).closeAsync() ); run( session, "RETURN 1" ); verifyRunAndPull( connection, "RETURN 1" ); }