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; } }
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; } }
public Neo4jTransactionProxy(ITransactionalGraphClient client, TransactionContext transactionContext, bool newScope) : base(client, transactionContext) { _doCommitInScope = newScope; }
protected TransactionScopeProxy(ITransactionalGraphClient client, TransactionContext transactionContext) { _client = client; _disposing = false; _transactionContext = transactionContext; }
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; } }
private TransactionContext GenerateTransaction(TransactionContext reference) { return new TransactionContext(reference.Transaction); }
private TransactionContext GenerateTransaction(TransactionContext reference) { return(new TransactionContext(reference.Transaction)); }