Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
TransactionStatePSPEOperation.cs
Go to the documentation of this file.
2
3namespace System.Transactions;
4
6{
7 internal override void EnterState(InternalTransaction tx)
8 {
10 }
11
16
17 internal void PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType)
18 {
20 try
21 {
22 promotableSinglePhaseNotification.Initialize();
23 tx._promoterType = promoterType;
24 }
25 finally
26 {
27 TransactionState.TransactionStateActive.CommonEnterState(tx);
28 }
29 }
30
31 internal void Phase0PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType)
32 {
34 try
35 {
36 promotableSinglePhaseNotification.Initialize();
37 tx._promoterType = promoterType;
38 }
39 finally
40 {
41 TransactionState.TransactionStatePhase0.CommonEnterState(tx);
42 }
43 }
44
46 {
47 bool flag = true;
50 DistributedTransaction distributedTransaction = null;
51 try
52 {
54 {
56 }
57 tx._attemptingPSPEPromote = true;
58 byte[] array = tx._promoter.Promote();
60 {
61 if (array == null)
62 {
64 }
65 tx.promotedToken = array;
66 return null;
67 }
68 if (array == null)
69 {
70 if (tx.PromotedTransaction == null)
71 {
73 }
74 flag = false;
75 distributedTransaction = tx.PromotedTransaction;
76 }
77 if (distributedTransaction == null)
78 {
79 try
80 {
82 }
83 catch (ArgumentException innerException)
84 {
86 }
87 if (TransactionManager.FindPromotedTransaction(distributedTransaction.Identifier) != null)
88 {
89 distributedTransaction.Dispose();
91 }
92 }
93 }
94 finally
95 {
96 tx._attemptingPSPEPromote = false;
97 if (flag)
98 {
99 state.CommonEnterState(tx);
100 }
101 }
102 return distributedTransaction;
103 }
104
105 internal override Enlistment PromoteAndEnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IPromotableSinglePhaseNotification promotableNotification, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
106 {
108 {
110 }
111 if (promotableNotification != tx._promoter)
112 {
114 }
115 tx._durableEnlistment = null;
118 Enlistment enlistment = tx.State.EnlistDurable(tx, resourceManagerIdentifier, enlistmentNotification, enlistmentOptions, atomicTransaction);
119 tx._durableEnlistment = enlistment.InternalEnlistment;
120 return enlistment;
121 }
122
123 internal override void SetDistributedTransactionId(InternalTransaction tx, IPromotableSinglePhaseNotification promotableNotification, Guid distributedTransactionIdentifier)
124 {
126 {
128 }
129 if (promotableNotification != tx._promoter)
130 {
132 }
133 tx._distributedTransactionIdentifierNonMSDTC = distributedTransactionIdentifier;
134 }
135}
static string InvalidIPromotableSinglePhaseNotificationSpecified
Definition SR.cs:36
static string PromotedReturnedInvalidValue
Definition SR.cs:44
static string PromotedTransactionExists
Definition SR.cs:46
Definition SR.cs:7
InternalEnlistment InternalEnlistment
Definition Enlistment.cs:7
static Exception CreateInvalidOperationException(TraceSourceType traceSource, string message, Exception innerException)
static TransactionException CreateTransactionStateException(Exception innerException, Guid distributedTxId)
static DistributedTransaction GetDistributedTransactionFromTransmitterPropagationToken(byte[] propagationToken)
static Transaction FindPromotedTransaction(Guid transactionIdentifier)
override TransactionStatus get_Status(InternalTransaction tx)
void Phase0PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType)
override void SetDistributedTransactionId(InternalTransaction tx, IPromotableSinglePhaseNotification promotableNotification, Guid distributedTransactionIdentifier)
void PSPEInitialize(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Guid promoterType)
override Enlistment PromoteAndEnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IPromotableSinglePhaseNotification promotableNotification, ISinglePhaseNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
DistributedTransaction PSPEPromote(InternalTransaction tx)
virtual Enlistment EnlistDurable(InternalTransaction tx, Guid resourceManagerIdentifier, IEnlistmentNotification enlistmentNotification, EnlistmentOptions enlistmentOptions, Transaction atomicTransaction)
static TransactionStatePhase0 TransactionStatePhase0
void EnterState(InternalTransaction tx)
void CommonEnterState(InternalTransaction tx)
static TransactionStatePromoted TransactionStatePromoted
static TransactionStateActive TransactionStateActive