Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetTransactionFromExportCookie()

static Transaction System.Transactions.TransactionInterop.GetTransactionFromExportCookie ( byte[] cookie)
inlinestatic

Definition at line 57 of file TransactionInterop.cs.

58 {
59 if (cookie == null)
60 {
61 throw new ArgumentNullException("cookie");
62 }
63 if (cookie.Length < 32)
64 {
65 throw new ArgumentException(System.SR.InvalidArgument, "cookie");
66 }
67 TransactionsEtwProvider log = TransactionsEtwProvider.Log;
68 if (log.IsEnabled())
69 {
70 log.MethodEnter(TraceSourceType.TraceSourceDistributed, "TransactionInterop.GetTransactionFromExportCookie");
71 }
72 byte[] array = new byte[cookie.Length];
73 Buffer.BlockCopy(cookie, 0, array, 0, cookie.Length);
74 cookie = array;
75 Guid guid = new Guid(cookie.AsSpan(16, 16));
76 Transaction transaction = TransactionManager.FindPromotedTransaction(guid);
77 if (transaction != null)
78 {
79 if (log.IsEnabled())
80 {
81 log.MethodExit(TraceSourceType.TraceSourceDistributed, "TransactionInterop.GetTransactionFromExportCookie");
82 }
83 return transaction;
84 }
86 transaction = TransactionManager.FindOrCreatePromotedTransaction(guid, transactionFromExportCookie);
87 if (log.IsEnabled())
88 {
89 log.MethodExit(TraceSourceType.TraceSourceDistributed, "TransactionInterop.GetTransactionFromExportCookie");
90 }
91 return transaction;
92 }
static string InvalidArgument
Definition SR.cs:34
Definition SR.cs:7
static DistributedTransaction GetTransactionFromExportCookie(byte[] cookie, Guid txId)

References System.array, System.Buffer.BlockCopy(), System.Transactions.TransactionManager.FindOrCreatePromotedTransaction(), System.Transactions.TransactionManager.FindPromotedTransaction(), System.Transactions.Distributed.DistributedTransactionManager.GetTransactionFromExportCookie(), System.SR.InvalidArgument, System.Diagnostics.Tracing.EventSource.IsEnabled(), System.Transactions.TransactionsEtwProvider.Log, System.Transactions.TransactionsEtwProvider.MethodEnter(), and System.Transactions.TransactionsEtwProvider.MethodExit().