public async Task Begin(ContextBag context, CancellationToken cancellationToken = default)
    {
        var incomingMessage = context.GetIncomingMessage();

        Connection = await connectionManager.OpenConnection(incomingMessage, cancellationToken).ConfigureAwait(false);

        Connection.EnlistTransaction(ambientTransaction);
        await concurrencyControlStrategy.Begin(incomingMessage.MessageId, Connection, null, cancellationToken).ConfigureAwait(false);
    }
예제 #2
0
    public async Task Begin(ContextBag context)
    {
        var incomingMessage = context.GetIncomingMessage();

        Connection = await connectionManager.OpenConnection(incomingMessage).ConfigureAwait(false);

        Transaction = Connection.BeginTransaction();
        await concurrencyControlStrategy.Begin(incomingMessage.MessageId, Connection, Transaction).ConfigureAwait(false);
    }
예제 #3
0
    public async Task Begin(ContextBag context)
    {
        transactionScope   = new TransactionScope(TransactionScopeOption.RequiresNew, TransactionScopeAsyncFlowOption.Enabled);
        ambientTransaction = System.Transactions.Transaction.Current;
        var incomingMessage = context.GetIncomingMessage();

        Connection = await connectionManager.OpenConnection(incomingMessage).ConfigureAwait(false);

        Connection.EnlistTransaction(ambientTransaction);
        await concurrencyControlStrategy.Begin(incomingMessage.MessageId, Connection, null).ConfigureAwait(false);
    }