Method BeginTransactionAsync
BeginTransactionAsync()
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.
Task<IAsyncTransaction> BeginTransactionAsync()
Returns
- Task<IAsyncTransaction>
A task of a new transaction.
BeginTransactionAsync(Action<TransactionConfigBuilder>)
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.
Task<IAsyncTransaction> BeginTransactionAsync(Action<TransactionConfigBuilder> action)
Parameters
actionAction<TransactionConfigBuilder>Given a TransactionConfigBuilder, defines how to set the configurations for the new transaction. This configuration overrides server side default transaction configurations. See TransactionConfig
Returns
- Task<IAsyncTransaction>
A task of a new transaction.
BeginTransactionAsync(AccessMode)
Asynchronously begin a new transaction specifying an access mode AccessMode 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.
Task<IAsyncTransaction> BeginTransactionAsync(AccessMode mode)
Parameters
modeAccessModeGiven a AccessMode specifying whether the query should be run on a read or write server.
Returns
- Task<IAsyncTransaction>
A task of a new transaction.
BeginTransactionAsync(AccessMode, Action<TransactionConfigBuilder>)
Asynchronously begin a new transaction specifying an access mode AccessMode and 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.
Task<IAsyncTransaction> BeginTransactionAsync(AccessMode mode, Action<TransactionConfigBuilder> action)
Parameters
modeAccessModeGiven a AccessMode specifying whether the query should be run on a read or write server.
actionAction<TransactionConfigBuilder>Given a TransactionConfigBuilder, defines how to set the configurations for the new transaction. This configuration overrides server side default transaction configurations. See TransactionConfig
Returns
- Task<IAsyncTransaction>
A task of a new transaction.