ADringer
ADringer

Reputation: 2834

Neo4jClient and async transactions

I'm implementing Neo4jClient to use async transactions and the wiki says :

To use the TransactionScope with async, assuming you're compiling against .NET >4.5.1 or higher, you construct the TransactionScope using the >TransactionScopeAsyncFlowOption parameter:

using (var scope = new > TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
    await client.Cypher.Create("(n:Tx {Name:'Test'})").ExecuteWithoutResultsAsync();
    scope.Complete();
}

But I can't find a reference to TransactionScope. I currently have:

using (ITransaction transaction = _client.BeginTransaction(TransactionScopeOption.RequiresNew))
{
    _client.Create(.....);
    transaction.Commit();
}

Is this the correct way to handle async transactions?

Thanks

Upvotes: 0

Views: 448

Answers (1)

Tatham Oddie
Tatham Oddie

Reputation: 4290

TransactionScope is System.Transactions.TransactionScope

Upvotes: 1

Related Questions