Click or drag to resize

IAsyncSession Interface

A live session with a Neo4j instance. Sessions serve a role in transaction isolation and ordering semantics. Within a session, transactions run sequentially one after another. Session objects are not thread safe, if you want to run concurrent operations against the database, simply create multiple session objects.

Namespace:  Neo4j.Driver
Assembly:  Neo4j.Driver (in Neo4j.Driver.dll) Version: 4.1.0
Syntax
public interface IAsyncSession : IAsyncQueryRunner

The IAsyncSession type exposes the following members.

Properties
  NameDescription
Public propertyLastBookmark
Gets the bookmark received following the last successfully completed IAsyncTransaction. If no bookmark was received or if this transaction was rolled back, the bookmark value will not be changed.
Public propertySessionConfig
Gets the session configurations back
Top
Methods
  NameDescription
Public methodBeginTransactionAsync
Asynchronously begin a new transaction in this session using server default transaction configurations. A session can have at most one transaction running at a time, if you want to run multiple concurrent transactions, you should use multiple concurrent sessions. All data operations in Neo4j are transactional. However, for convenience we provide a RunAsync(Query) method directly on this session interface as well. When you use that method, your query automatically gets wrapped in a transaction. If you want to run multiple queries in the same transaction, you should wrap them in a transaction using this method.
Public methodBeginTransactionAsync(ActionTransactionConfigBuilder)
Asynchronously begin a new transaction with a specific TransactionConfig in this session. A session can have at most one transaction running at a time, if you want to run multiple concurrent transactions, you should use multiple concurrent sessions. All data operations in Neo4j are transactional. However, for convenience we provide a RunAsync(Query) method directly on this session interface as well. When you use that method, your query automatically gets wrapped in a transaction. If you want to run multiple queries in the same transaction, you should wrap them in a transaction using this method.
Public methodCloseAsync
Close all resources used in this Session. If any transaction is left open in this session without commit or rollback, then this method will rollback the transaction.
Public methodReadTransactionAsync(FuncIAsyncTransaction, Task)
Asynchronously execute given unit of work in a Read transaction.
Public methodReadTransactionAsync(FuncIAsyncTransaction, Task, ActionTransactionConfigBuilder)
Asynchronously execute given unit of work in a Read transaction with a specific TransactionConfig.
Public methodReadTransactionAsyncT(FuncIAsyncTransaction, TaskT)
Asynchronously execute given unit of work in a Read transaction.
Public methodReadTransactionAsyncT(FuncIAsyncTransaction, TaskT, ActionTransactionConfigBuilder)
Asynchronously execute given unit of work in a Read transaction with a specific TransactionConfig.
Public methodRunAsync(String)
Asynchronously run a query and return a task of result stream. This method accepts a String representing a Cypher query which will be compiled into a query object that can be used to efficiently execute this query multiple times. This method optionally accepts a set of parameters which will be injected into the query object query by Neo4j.
(Inherited from IAsyncQueryRunner.)
Public methodRunAsync(Query)
Asynchronously execute a query and return a task of result stream.
(Inherited from IAsyncQueryRunner.)
Public methodRunAsync(String, IDictionaryString, Object)
Asynchronously run a query and return a task of result stream. This method accepts a String representing a Cypher query which will be compiled into a query object that can be used to efficiently execute this query multiple times. This method optionally accepts a set of parameters which will be injected into the query object query by Neo4j.
(Inherited from IAsyncQueryRunner.)
Public methodRunAsync(String, Object)
Asynchronously execute a query and return a task of result stream.
(Inherited from IAsyncQueryRunner.)
Public methodRunAsync(String, ActionTransactionConfigBuilder)
Asynchronously run a query with the specific TransactionConfig and return a task of result stream. This method accepts a String representing a Cypher query which will be compiled into a query object that can be used to efficiently execute this query multiple times. This method optionally accepts a set of parameters which will be injected into the query object query by Neo4j.
Public methodRunAsync(Query, ActionTransactionConfigBuilder)
Asynchronously execute a query with the specific TransactionConfig and return a task of result stream.
Public methodRunAsync(String, IDictionaryString, Object, ActionTransactionConfigBuilder)
Asynchronously run a query with the customized TransactionConfig and return a task of result stream. This method accepts a String representing a Cypher query which will be compiled into a query object that can be used to efficiently execute this query multiple times. This method optionally accepts a set of parameters which will be injected into the query object query by Neo4j.
Public methodWriteTransactionAsync(FuncIAsyncTransaction, Task)
Asynchronously execute given unit of work in a Write transaction.
Public methodWriteTransactionAsync(FuncIAsyncTransaction, Task, ActionTransactionConfigBuilder)
Asynchronously execute given unit of work in a Write transaction with a specific TransactionConfig.
Public methodWriteTransactionAsyncT(FuncIAsyncTransaction, TaskT)
Asynchronously execute given unit of work in a Write transaction.
Public methodWriteTransactionAsyncT(FuncIAsyncTransaction, TaskT, ActionTransactionConfigBuilder)
Asynchronously execute given unit of work in a Write transaction with a specific TransactionConfig.
Top
See Also