Encapsulates a transaction object with its transaction scheduler.
All requests to the same transaction have to made sequentially. The purpose of this class is to ensure that such calls are made in that fashion.
Inheritance: INeo4jTransaction
コード例 #1
0
        public virtual void Dispose()
        {
            if (_disposing)
            {
                return;
            }

            _disposing = true;
            _client.EndTransaction();
            if (!_markCommitted && Committable && TransactionContext.IsOpen)
            {
                Rollback();
            }

            if (_transactionContext != null && ShouldDisposeTransaction())
            {
                _transactionContext.Dispose();
                _transactionContext = null;
            }
        }
コード例 #2
0
        private TransactionContext GetOrCreateDtcTransactionContext(NameValueCollection customHeaders = null)
        {
            // we need to lock as we could get other async requests to the same transaction
            var txId = Transaction.Current.TransactionInformation.LocalIdentifier;
            lock (dtcContexts)
            {
                TransactionContext txContext;
                if (dtcContexts.TryGetValue(txId, out txContext))
                {
                    return txContext;
                }

                // associate it with the ambient transaction
                txContext = new TransactionContext(promotable.AmbientTransaction)
                {
                    Transaction = {CustomHeaders = customHeaders},
                    CustomHeaders = customHeaders
                };
                dtcContexts[txId] = txContext;
                
                return txContext;
            }
        }
コード例 #3
0
 public Neo4jTransactionProxy(ITransactionalGraphClient client, TransactionContext transactionContext, bool newScope)
     : base(client, transactionContext)
 {
     _doCommitInScope = newScope;
 }
コード例 #4
0
 protected TransactionScopeProxy(ITransactionalGraphClient client, TransactionContext transactionContext)
 {
     _client = client;
     _disposing = false;
     _transactionContext = transactionContext;
 }
コード例 #5
0
        private TransactionContext GetOrCreateDtcTransactionContext()
        {
            // we need to lock as we could get other async requests to the same transaction
            var txId = Transaction.Current.TransactionInformation.LocalIdentifier;
            lock (_dtcContexts)
            {
                TransactionContext txContext;
                if (_dtcContexts.TryGetValue(txId, out txContext))
                {
                    return txContext;
                }

                // associate it with the ambient transaction
                txContext = new TransactionContext(_promotable.AmbientTransaction);
                _dtcContexts[txId] = txContext;

                return txContext;
            }
        }
コード例 #6
0
 private TransactionContext GenerateTransaction(TransactionContext reference)
 {
     return new TransactionContext(reference.Transaction);
 }
コード例 #7
0
 private TransactionContext GenerateTransaction(TransactionContext reference)
 {
     return(new TransactionContext(reference.Transaction));
 }