Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TransactionStatePromotedNonMSDTCBase.cs
Go to the documentation of this file.
1namespace System.Transactions;
2
4{
6 {
7 return TransactionStatus.Active;
8 }
9
10 internal override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
11 {
12 Enlistment enlistment = new Enlistment(tx, enlistmentNotification, null, atomicTransaction, enlistmentOptions);
13 if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != 0)
14 {
15 AddVolatileEnlistment(ref tx._phase0Volatiles, enlistment);
16 }
17 else
18 {
19 AddVolatileEnlistment(ref tx._phase1Volatiles, enlistment);
20 }
22 if (log.IsEnabled())
23 {
24 log.TransactionstateEnlist(enlistment.InternalEnlistment.EnlistmentTraceId, EnlistmentType.Volatile, enlistmentOptions);
25 }
26 return enlistment;
27 }
28
29 internal override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
30 {
31 Enlistment enlistment = new Enlistment(tx, enlistmentNotification, enlistmentNotification, atomicTransaction, enlistmentOptions);
32 if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != 0)
33 {
34 AddVolatileEnlistment(ref tx._phase0Volatiles, enlistment);
35 }
36 else
37 {
38 AddVolatileEnlistment(ref tx._phase1Volatiles, enlistment);
39 }
41 if (log.IsEnabled())
42 {
43 log.TransactionstateEnlist(enlistment.InternalEnlistment.EnlistmentTraceId, EnlistmentType.Volatile, enlistmentOptions);
44 }
45 return enlistment;
46 }
47
48 internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
49 {
51 }
52
53 internal override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
54 {
56 }
57
58 internal override bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
59 {
60 return false;
61 }
62
63 internal override void Rollback(InternalTransaction tx, Exception e)
64 {
65 if (tx._innerException == null)
66 {
67 tx._innerException = e;
68 }
70 }
71
76
77 internal override void AddOutcomeRegistrant(InternalTransaction tx, TransactionCompletedEventHandler transactionCompletedDelegate)
78 {
79 tx._transactionCompletedDelegate = (TransactionCompletedEventHandler)Delegate.Combine(tx._transactionCompletedDelegate, transactionCompletedDelegate);
80 }
81
82 internal override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
83 {
84 tx._asyncCommit = asyncCommit;
85 tx._asyncCallback = asyncCallback;
86 tx._asyncState = asyncState;
88 }
89
101
103 {
105 }
106
107 internal override void CreateBlockingClone(InternalTransaction tx)
108 {
110 }
111
112 internal override void CreateAbortingClone(InternalTransaction tx)
113 {
115 }
116
117 internal override bool ContinuePhase0Prepares()
118 {
119 return true;
120 }
121
123 {
124 if (tx._innerException == null)
125 {
126 tx._innerException = e;
127 }
129 }
130
135
137 {
139 }
140
141 internal override void Timeout(InternalTransaction tx)
142 {
144 if (log.IsEnabled())
145 {
147 }
149 Rollback(tx, e);
150 }
151
152 internal override void Promote(InternalTransaction tx)
153 {
154 }
155
157 {
158 }
159
161 {
162 }
163
164 internal override byte[] PromotedToken(InternalTransaction tx)
165 {
166 return tx.promotedToken;
167 }
168
169 internal override void DisposeRoot(InternalTransaction tx)
170 {
171 tx.State.Rollback(tx, null);
172 }
173}
static ? Delegate Combine(Delegate? a, Delegate? b)
Definition Delegate.cs:379
static string PromoterTypeUnrecognized
Definition SR.cs:84
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string TraceTransactionTimeout
Definition SR.cs:50
Definition SR.cs:7
InternalEnlistment InternalEnlistment
Definition Enlistment.cs:7
EnlistmentTraceIdentifier EnlistmentTraceId
TransactionCompletedEventHandler _transactionCompletedDelegate
TransactionTraceIdentifier TransactionTraceId
override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override void ChangeStateTransactionAborted(InternalTransaction tx, Exception e)
override TransactionStatus get_Status(InternalTransaction tx)
override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
override Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override void AddOutcomeRegistrant(InternalTransaction tx, TransactionCompletedEventHandler transactionCompletedDelegate)
override bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
static TransactionStatePromotedNonMSDTCIndoubt TransactionStatePromotedNonMSDTCIndoubt
static TransactionStatePromotedNonMSDTCPhase0 TransactionStatePromotedNonMSDTCPhase0
static TransactionStateAborted TransactionStateAborted
virtual void Rollback(InternalTransaction tx, Exception e)
void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
virtual void Phase0VolatilePrepareDone(InternalTransaction tx)
void TransactionTimeout(TransactionTraceIdentifier transactionID)
void TransactionstateEnlist(EnlistmentTraceIdentifier enlistmentID, EnlistmentType enlistmentType, EnlistmentOptions enlistmentOption)
static readonly TransactionsEtwProvider Log
delegate void TransactionCompletedEventHandler(object? sender, TransactionEventArgs e)
override string ToString()
Definition Guid.cs:695