Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TransactionStateActive.cs
Go to the documentation of this file.
1namespace System.Transactions;
2
4{
5 internal override void EnterState(InternalTransaction tx)
6 {
8 }
9
10 internal override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
11 {
12 tx._asyncCommit = asyncCommit;
13 tx._asyncCallback = asyncCallback;
14 tx._asyncState = asyncState;
16 }
17
18 internal override void Rollback(InternalTransaction tx, Exception e)
19 {
20 if (tx._innerException == null)
21 {
22 tx._innerException = e;
23 }
25 }
26
27 internal override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
28 {
29 Enlistment enlistment = new Enlistment(tx, enlistmentNotification, null, atomicTransaction, enlistmentOptions);
30 if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != 0)
31 {
32 AddVolatileEnlistment(ref tx._phase0Volatiles, enlistment);
33 }
34 else
35 {
36 AddVolatileEnlistment(ref tx._phase1Volatiles, enlistment);
37 }
39 if (log.IsEnabled())
40 {
41 log.TransactionstateEnlist(enlistment.InternalEnlistment.EnlistmentTraceId, EnlistmentType.Volatile, enlistmentOptions);
42 }
43 return enlistment;
44 }
45
46 internal override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
47 {
48 Enlistment enlistment = new Enlistment(tx, enlistmentNotification, enlistmentNotification, atomicTransaction, enlistmentOptions);
49 if ((enlistmentOptions & EnlistmentOptions.EnlistDuringPrepareRequired) != 0)
50 {
51 AddVolatileEnlistment(ref tx._phase0Volatiles, enlistment);
52 }
53 else
54 {
55 AddVolatileEnlistment(ref tx._phase1Volatiles, enlistment);
56 }
58 if (log.IsEnabled())
59 {
60 log.TransactionstateEnlist(enlistment.InternalEnlistment.EnlistmentTraceId, EnlistmentType.Volatile, enlistmentOptions);
61 }
62 return enlistment;
63 }
64
65 internal override bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
66 {
67 if (tx._durableEnlistment != null)
68 {
69 return false;
70 }
71 TransactionState.TransactionStatePSPEOperation.PSPEInitialize(tx, promotableSinglePhaseNotification, promoterType);
72 Enlistment enlistment = new Enlistment(tx, promotableSinglePhaseNotification, atomicTransaction);
73 tx._durableEnlistment = enlistment.InternalEnlistment;
75 if (log.IsEnabled())
76 {
78 }
79 tx._promoter = promotableSinglePhaseNotification;
81 {
83 }
84 else
85 {
87 }
89 return true;
90 }
91
93 {
94 }
95
97 {
98 }
99
100 internal override void DisposeRoot(InternalTransaction tx)
101 {
102 tx.State.Rollback(tx, null);
103 }
104}
static DurableEnlistmentActive DurableEnlistmentActive
InternalEnlistment InternalEnlistment
Definition Enlistment.cs:7
EnlistmentTraceIdentifier EnlistmentTraceId
override void Phase0VolatilePrepareDone(InternalTransaction tx)
override void Rollback(InternalTransaction tx, Exception e)
override Enlistment EnlistVolatile(InternalTransaction tx, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
override void BeginCommit(InternalTransaction tx, bool asyncCommit, AsyncCallback asyncCallback, object asyncState)
override void EnterState(InternalTransaction tx)
override void DisposeRoot(InternalTransaction tx)
override void Phase1VolatilePrepareDone(InternalTransaction tx)
override bool EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction, Guid promoterType)
override Enlistment EnlistVolatile(InternalTransaction tx, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
static TransactionStateAborted TransactionStateAborted
virtual void Rollback(InternalTransaction tx, Exception e)
static TransactionStateDelegated TransactionStateDelegated
static TransactionStatePSPEOperation TransactionStatePSPEOperation
void AddVolatileEnlistment(ref VolatileEnlistmentSet enlistments, Enlistment enlistment)
static TransactionStatePhase0 TransactionStatePhase0
void CommonEnterState(InternalTransaction tx)
static TransactionStateDelegatedNonMSDTC TransactionStateDelegatedNonMSDTC
void TransactionstateEnlist(EnlistmentTraceIdentifier enlistmentID, EnlistmentType enlistmentType, EnlistmentOptions enlistmentOption)
static readonly TransactionsEtwProvider Log