Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TransactionState.cs
Go to the documentation of this file.
2
3namespace System.Transactions;
4
5internal abstract class TransactionState
6{
8
10
12
14
16
18
20
22
24
26
28
30
32
34
36
38
40
42
44
46
48
50
52
54
56
58
60
62
64
66
67 internal static object s_classSyncObject;
68
70
72
74
76
78
80
82
84
86
88
90
92
94
96
98
100
102
104
106
108
110
112
114
116
118
120
122
124
126
128
130 {
131 tx.State = this;
132 }
133
134 internal abstract void EnterState(InternalTransaction tx);
135
136 internal virtual void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
137 {
139 }
140
145
150
151 internal virtual Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
152 {
154 }
155
156 internal virtual Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
157 {
159 }
160
161 internal virtual Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
162 {
164 }
165
166 internal virtual Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
167 {
169 }
170
172 {
173 }
174
176 {
177 return Guid.Empty;
178 }
179
181
182 internal virtual void AddOutcomeRegistrant(InternalTransaction tx, TransactionCompletedEventHandler transactionCompletedDelegate)
183 {
185 }
186
187 internal virtual bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
188 {
190 }
191
193 {
194 }
195
197 {
198 }
199
204
209
211 {
213 if (log.IsEnabled())
214 {
215 log.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, tx?.TransactionTraceId.TransactionIdentifier ?? string.Empty, e.ToString());
216 }
217 throw new InvalidOperationException();
218 }
219
221 {
223 if (log.IsEnabled())
224 {
225 log.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, tx?.TransactionTraceId.TransactionIdentifier ?? string.Empty, string.Empty);
226 }
227 throw new InvalidOperationException();
228 }
229
231 {
233 if (log.IsEnabled())
234 {
235 log.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, tx?.TransactionTraceId.TransactionIdentifier ?? string.Empty, string.Empty);
236 }
237 throw new InvalidOperationException();
238 }
239
241 {
243 if (log.IsEnabled())
244 {
245 log.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, tx?.TransactionTraceId.TransactionIdentifier ?? string.Empty, string.Empty);
246 }
247 throw new InvalidOperationException();
248 }
249
251 {
253 if (log.IsEnabled())
254 {
255 log.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, tx?.TransactionTraceId.TransactionIdentifier ?? string.Empty, string.Empty);
256 }
257 throw new InvalidOperationException();
258 }
259
261 {
263 if (log.IsEnabled())
264 {
265 log.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, tx?.TransactionTraceId.TransactionIdentifier ?? string.Empty, string.Empty);
266 }
267 throw new InvalidOperationException();
268 }
269
270 internal virtual void Timeout(InternalTransaction tx)
271 {
272 }
273
278
283
285 {
287 if (log.IsEnabled())
288 {
289 log.TransactionExceptionTrace(TransactionExceptionType.InvalidOperationException, tx?.TransactionTraceId.TransactionIdentifier ?? string.Empty, string.Empty);
290 }
291 throw new InvalidOperationException();
292 }
293
294 internal virtual bool ContinuePhase0Prepares()
295 {
296 return false;
297 }
298
299 internal virtual bool ContinuePhase1Prepares()
300 {
301 return false;
302 }
303
308
313
314 internal virtual Enlistment PromoteAndEnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IPromotableSinglePhaseNotification promotableNotification, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
315 {
317 }
318
319 internal virtual void SetDistributedTransactionId(InternalTransaction tx, IPromotableSinglePhaseNotification promotableNotification, Guid distributedTransactionIdentifier)
320 {
322 }
323
324 internal virtual void DisposeRoot(InternalTransaction tx)
325 {
326 }
327
328 internal virtual bool IsCompleted(InternalTransaction tx)
329 {
330 tx._needPulse = true;
331 return false;
332 }
333
334 protected void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
335 {
336 if (enlistments._volatileEnlistmentCount == enlistments._volatileEnlistmentSize)
337 {
338 InternalEnlistment[] array = new InternalEnlistment[enlistments._volatileEnlistmentSize + 8];
339 if (enlistments._volatileEnlistmentSize > 0)
340 {
341 Array.Copy(enlistments._volatileEnlistments, 0, array, 0, enlistments._volatileEnlistmentSize);
342 }
343 enlistments._volatileEnlistmentSize += 8;
344 enlistments._volatileEnlistments = array;
345 }
346 enlistments._volatileEnlistments[enlistments._volatileEnlistmentCount] = enlistment.InternalEnlistment;
347 enlistments._volatileEnlistmentCount++;
348 VolatileEnlistmentState.VolatileEnlistmentActive.EnterState(enlistments._volatileEnlistments[enlistments._volatileEnlistmentCount - 1]);
349 }
350}
static unsafe void Copy(Array sourceArray, Array destinationArray, int length)
Definition Array.cs:624
override string ToString()
Definition Exception.cs:384
InternalEnlistment InternalEnlistment
Definition Enlistment.cs:7
TransactionTraceIdentifier TransactionTraceId
static TransactionException CreateTransactionStateException(Exception innerException, Guid distributedTxId)
virtual void InDoubtFromEnlistment(InternalTransaction tx)
virtual void CompleteBlockingClone(InternalTransaction tx)
static TransactionStateDelegatedCommitting TransactionStateDelegatedCommitting
static TransactionStatePSPEOperation s_transactionStatePSPEOperation
virtual void Phase1VolatilePrepareDone(InternalTransaction tx)
static TransactionStatePromotedP0Wave TransactionStatePromotedP0Wave
static TransactionStateInDoubt TransactionStateInDoubt
static TransactionStateVolatileSPC TransactionStateVolatileSPC
static TransactionStatePromotedNonMSDTCIndoubt TransactionStatePromotedNonMSDTCIndoubt
virtual void ChangeStatePromotedCommitted(InternalTransaction tx)
virtual byte[] PromotedToken(InternalTransaction tx)
static TransactionStatePromotedNonMSDTCPhase0 TransactionStatePromotedNonMSDTCPhase0
static TransactionStateAborted TransactionStateAborted
virtual Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
static TransactionStateNonCommittablePromoted TransactionStateNonCommittablePromoted
virtual void CreateAbortingClone(InternalTransaction tx)
static TransactionStateDelegatedAborting s_transactionStateDelegatedAborting
virtual void Rollback(InternalTransaction tx, Exception e)
static TransactionStateVolatilePhase1 s_transactionStateVolatilePhase1
static TransactionStatePromotedNonMSDTCCommitted s_transactionStatePromotedNonMSDTCCommitted
static TransactionStateSubordinateActive TransactionStateSubordinateActive
static TransactionStatePromotedNonMSDTCVolatilePhase1 s_transactionStatePromotedNonMSDTCVolatilePhase1
virtual void ChangeStateTransactionAborted(InternalTransaction tx, Exception e)
static TransactionStateDelegated TransactionStateDelegated
virtual Enlistment PromoteAndEnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IPromotableSinglePhaseNotification promotableNotification, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
virtual void CompleteAbortingClone(InternalTransaction tx)
virtual void ChangeStateAbortedDuringPromotion(InternalTransaction tx)
virtual void CheckForFinishedTransaction(InternalTransaction tx)
static TransactionStateDelegatedCommitting s_transactionStateDelegatedCommitting
static TransactionStateCommitted s_transactionStateCommitted
static TransactionStatePromotedCommitted s_transactionStatePromotedCommitted
virtual Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
static TransactionStateDelegatedAborting TransactionStateDelegatedAborting
static TransactionStateDelegatedNonMSDTC s_transactionStateDelegatedNonMSDTC
virtual void ChangeStatePromotedAborted(InternalTransaction tx)
static TransactionStateSPC TransactionStateSPC
virtual void ChangeStateTransactionCommitted(InternalTransaction tx)
static TransactionStateActive s_transactionStateActive
static TransactionStatePromotedIndoubt TransactionStatePromotedIndoubt
static TransactionStatePromotedNonMSDTCIndoubt s_transactionStatePromotedNonMSDTCIndoubt
static TransactionStatePromotedNonMSDTCAborted TransactionStatePromotedNonMSDTCAborted
static TransactionStatePSPEOperation TransactionStatePSPEOperation
virtual void EndCommit(InternalTransaction tx)
TransactionStatus get_Status(InternalTransaction tx)
static TransactionStatePromotedNonMSDTCVolatilePhase1 TransactionStatePromotedNonMSDTCVolatilePhase1
virtual void CreateBlockingClone(InternalTransaction tx)
static TransactionStateDelegatedP0Wave s_transactionStateDelegatedP0Wave
void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
static TransactionStatePhase0 TransactionStatePhase0
static TransactionStateVolatilePhase1 TransactionStateVolatilePhase1
virtual void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
static TransactionStatePromoted s_transactionStatePromoted
static TransactionStatePromotedAborted TransactionStatePromotedAborted
void EnterState(InternalTransaction tx)
virtual void DisposeRoot(InternalTransaction tx)
static TransactionStatePromotedCommitting s_transactionStatePromotedCommitting
void CommonEnterState(InternalTransaction tx)
static TransactionStateCommitted TransactionStateCommitted
static TransactionStatePhase0 s_transactionStatePhase0
virtual void AddOutcomeRegistrant(InternalTransaction tx, TransactionCompletedEventHandler transactionCompletedDelegate)
virtual void Timeout(InternalTransaction tx)
static TransactionStateDelegatedSubordinate s_transactionStateDelegatedSubordinate
virtual Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
virtual Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
static TransactionStatePromotedNonMSDTCAborted s_transactionStatePromotedNonMSDTCAborted
static TransactionStateSPC s_transactionStateSPC
virtual bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
static TransactionStateVolatileSPC s_transactionStateVolatileSPC
virtual void Promote(InternalTransaction tx)
static TransactionStatePromotedP0Aborting TransactionStatePromotedP0Aborting
static TransactionStatePromotedIndoubt s_transactionStatePromotedIndoubt
virtual void RestartCommitIfNeeded(InternalTransaction tx)
static TransactionStateInDoubt s_transactionStateInDoubt
static TransactionStateDelegated s_transactionStateDelegated
virtual Guid get_Identifier(InternalTransaction tx)
static TransactionStatePromotedAborted s_transactionStatePromotedAborted
static TransactionStatePromotedNonMSDTCCommitted TransactionStatePromotedNonMSDTCCommitted
static TransactionStatePromotedNonMSDTCPhase0 s_transactionStatePromotedNonMSDTCPhase0
virtual bool IsCompleted(InternalTransaction tx)
static TransactionStatePromotedNonMSDTCSinglePhaseCommit s_transactionStatePromotedNonMSDTCSinglePhaseCommit
virtual void SetDistributedTransactionId(InternalTransaction tx, IPromotableSinglePhaseNotification promotableNotification, Guid distributedTransactionIdentifier)
static TransactionStateNonCommittablePromoted s_transactionStateNonCommittablePromoted
static TransactionStateDelegatedSubordinate TransactionStateDelegatedSubordinate
static TransactionStatePromotedP0Wave s_transactionStatePromotedP0Wave
static TransactionStateDelegatedP0Wave TransactionStateDelegatedP0Wave
static TransactionStatePromotedCommitting TransactionStatePromotedCommitting
static TransactionStatePromoted TransactionStatePromoted
static TransactionStateSubordinateActive s_transactionStateSubordinateActive
static TransactionStatePromotedCommitted TransactionStatePromotedCommitted
static TransactionStateActive TransactionStateActive
static TransactionStateAborted s_transactionStateAborted
virtual void Phase0VolatilePrepareDone(InternalTransaction tx)
static TransactionStateDelegatedNonMSDTC TransactionStateDelegatedNonMSDTC
static TransactionStatePromotedNonMSDTCSinglePhaseCommit TransactionStatePromotedNonMSDTCSinglePhaseCommit
static TransactionStatePromotedP0Aborting s_transactionStatePromotedP0Aborting
void TransactionExceptionTrace(TraceSourceType traceSource, TransactionExceptionType type, string message, string innerExceptionStr)
static readonly TransactionsEtwProvider Log
static VolatileEnlistmentActive VolatileEnlistmentActive
static readonly Guid Empty
Definition Guid.cs:86