- All Implemented Interfaces:
AsyncQueryRunner
,AsyncTransaction
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClose the transaction.Commit this transaction in asynchronous fashion.boolean
isOpen()
Determine if transaction is open.Rollback this transaction in asynchronous fashion.Run a query asynchronously and return aCompletionStage
with a result cursor.Methods inherited from class org.neo4j.driver.internal.async.AsyncAbstractQueryRunner
runAsync, runAsync, runAsync, runAsync
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.neo4j.driver.async.AsyncQueryRunner
runAsync, runAsync, runAsync, runAsync
-
Constructor Details
-
InternalAsyncTransaction
-
-
Method Details
-
commitAsync
Description copied from interface:AsyncTransaction
Commit this transaction in asynchronous fashion. This operation is typically executed as part of theCompletionStage
chain that starts with a transaction. There is no need to close transaction after calling this method. Transaction object should not be used after calling this method.Returned stage can be completed by an IO thread which should never block. Otherwise IO operations on this and potentially other network connections might deadlock. Please do not chain blocking operations like
CompletableFuture.get()
on the returned stage. Consider using asynchronous calls throughout the chain or offloading blocking operation to a differentExecutor
. This can be done using methods with "Async" suffix likeCompletionStage.thenApplyAsync(Function)
orCompletionStage.thenApplyAsync(Function, Executor)
.- Specified by:
commitAsync
in interfaceAsyncTransaction
- Returns:
- new
CompletionStage
that gets completed withnull
when commit is successful. Stage can be completed exceptionally when commit fails.
-
rollbackAsync
Description copied from interface:AsyncTransaction
Rollback this transaction in asynchronous fashion. This operation is typically executed as part of theCompletionStage
chain that starts with a transaction. There is no need to close transaction after calling this method. Transaction object should not be used after calling this method.Returned stage can be completed by an IO thread which should never block. Otherwise IO operations on this and potentially other network connections might deadlock. Please do not chain blocking operations like
CompletableFuture.get()
on the returned stage. Consider using asynchronous calls throughout the chain or offloading blocking operation to a differentExecutor
. This can be done using methods with "Async" suffix likeCompletionStage.thenApplyAsync(Function)
orCompletionStage.thenApplyAsync(Function, Executor)
.- Specified by:
rollbackAsync
in interfaceAsyncTransaction
- Returns:
- new
CompletionStage
that gets completed withnull
when rollback is successful. Stage can be completed exceptionally when rollback fails.
-
closeAsync
Description copied from interface:AsyncTransaction
Close the transaction. If the transaction has beencommitted
orrolled back
, the close is optional and no operation is performed. Otherwise, the transaction will be rolled back by default by this method.- Specified by:
closeAsync
in interfaceAsyncTransaction
- Returns:
- new
CompletionStage
that gets completed withnull
when close is successful, otherwise it gets completed exceptionally.
-
isOpenAsync
Description copied from interface:AsyncTransaction
Determine if transaction is open.- Specified by:
isOpenAsync
in interfaceAsyncTransaction
- Returns:
- a
CompletionStage
completed withtrue
if transaction is open andfalse
otherwise.
-
runAsync
Description copied from interface:AsyncQueryRunner
Run a query asynchronously and return aCompletionStage
with a result cursor.Example
Query query = new Query( "MATCH (n) WHERE n.name = $myNameParam RETURN n.age" ); CompletionStage<ResultCursor> cursorStage = session.runAsync(query);
CompletionStage
. See class javadoc for more information.- Specified by:
runAsync
in interfaceAsyncQueryRunner
- Parameters:
query
- a Neo4j query- Returns:
- new
CompletionStage
that gets completed with a result cursor when query execution is successful. Stage can be completed exceptionally when error happens, e.g. connection can't be acquired from the pool.
-
isOpen
public boolean isOpen()
-