-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
ISinglePhaseNotification.xml
124 lines (114 loc) · 9.69 KB
/
ISinglePhaseNotification.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<Type Name="ISinglePhaseNotification" FullName="System.Transactions.ISinglePhaseNotification">
<TypeSignature Language="C#" Value="public interface ISinglePhaseNotification : System.Transactions.IEnlistmentNotification" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract ISinglePhaseNotification implements class System.Transactions.IEnlistmentNotification" FrameworkAlternate="net-5.0;net-6.0;net-7.0;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netcore-3.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1;netstandard-2.0;netstandard-2.1" />
<TypeSignature Language="DocId" Value="T:System.Transactions.ISinglePhaseNotification" />
<TypeSignature Language="VB.NET" Value="Public Interface ISinglePhaseNotification
Implements IEnlistmentNotification" />
<TypeSignature Language="F#" Value="type ISinglePhaseNotification = interface
 interface IEnlistmentNotification" />
<TypeSignature Language="C++ CLI" Value="public interface class ISinglePhaseNotification : System::Transactions::IEnlistmentNotification" />
<TypeSignature Language="ILAsm" Value=".class public interface auto ansi abstract beforefieldinit ISinglePhaseNotification implements class System.Transactions.IEnlistmentNotification" FrameworkAlternate="net-8.0;net-9.0" />
<AssemblyInfo>
<AssemblyName>System.Transactions</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Transactions.Local</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Transactions.Local" ToVersion="5.0.0.0" FrameworkAlternate="net-5.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Transactions.Local" ToVersion="6.0.0.0" FrameworkAlternate="net-6.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Transactions.Local" ToVersion="7.0.0.0" FrameworkAlternate="net-7.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Transactions.Local" ToVersion="8.0.0.0" FrameworkAlternate="net-8.0" />
<TypeForwarding From="netstandard" FromVersion="2.1.0.0" To="System.Transactions.Local" ToVersion="9.0.0.0" FrameworkAlternate="net-9.0" />
</TypeForwardingChain>
<Interfaces>
<Interface>
<InterfaceName>System.Transactions.IEnlistmentNotification</InterfaceName>
</Interface>
</Interfaces>
<Docs>
<summary>Describes a resource object that supports single phase commit optimization to participate in a transaction.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You should note that even when your resource manager implements this interface to support single phase commit optimization, it is not guaranteed that it receives a single phase commit. The transaction manager can still send two phase commit notifications instead.
To enlist your resource manager as a participant in a transaction, call the <xref:System.Transactions.Transaction.EnlistVolatile%2A> method or the <xref:System.Transactions.Transaction.EnlistDurable%2A> method of the <xref:System.Transactions.Transaction> class. Specifically, the `EnlistmentOptions` parameter should equal to <xref:System.Transactions.EnlistmentOptions.None> to ensure that a single phase commit is performed. If it is mistakenly set to <xref:System.Transactions.EnlistmentOptions.EnlistDuringPrepareRequired>, no single phase commit occurs.
Since the <xref:System.Transactions.ISinglePhaseNotification> interface derives from the <xref:System.Transactions.IEnlistmentNotification> interface, the resource manager must also implement all the methods of the latter for two phase commit notifications. It is the transaction manager's choice as to whether two phase commit or the single phase commit optimization is used with this resource manager. However, implementing this interface gives the resource manager the opportunity to take advantage of the optimization when it is available.
If the optimization is used and the transaction manager calls the <xref:System.Transactions.ISinglePhaseNotification.SinglePhaseCommit%2A> method of the enlisted resource, the resource manager should respond to this call by using various methods of the <xref:System.Transactions.SinglePhaseEnlistment> class to inform the transaction manager if the transaction is to be committed or rolled back.
]]></format>
</remarks>
<altmember cref="T:System.Transactions.IEnlistmentNotification" />
</Docs>
<Members>
<Member MemberName="SinglePhaseCommit">
<MemberSignature Language="C#" Value="public void SinglePhaseCommit (System.Transactions.SinglePhaseEnlistment singlePhaseEnlistment);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void SinglePhaseCommit(class System.Transactions.SinglePhaseEnlistment singlePhaseEnlistment) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Transactions.ISinglePhaseNotification.SinglePhaseCommit(System.Transactions.SinglePhaseEnlistment)" />
<MemberSignature Language="VB.NET" Value="Public Sub SinglePhaseCommit (singlePhaseEnlistment As SinglePhaseEnlistment)" />
<MemberSignature Language="F#" Value="abstract member SinglePhaseCommit : System.Transactions.SinglePhaseEnlistment -> unit" Usage="iSinglePhaseNotification.SinglePhaseCommit singlePhaseEnlistment" />
<MemberSignature Language="C++ CLI" Value="public:
 void SinglePhaseCommit(System::Transactions::SinglePhaseEnlistment ^ singlePhaseEnlistment);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Transactions</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Transactions.Local</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.1.0</AssemblyVersion>
<AssemblyVersion>4.0.2.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="net-8.0;net-9.0">
<AttributeName Language="C#">[System.Runtime.CompilerServices.NullableContext(1)]</AttributeName>
<AttributeName Language="F#">[<System.Runtime.CompilerServices.NullableContext(1)>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="singlePhaseEnlistment" Type="System.Transactions.SinglePhaseEnlistment" />
</Parameters>
<Docs>
<param name="singlePhaseEnlistment">A <see cref="T:System.Transactions.SinglePhaseEnlistment" /> used to send a response to the transaction manager.</param>
<summary>Represents the resource manager's implementation of the callback for the single phase commit optimization.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
It is the transaction manager's choice as to whether two phase commit or the single phase commit optimization is used with this resource manager. For more information on single phase and two phase commit, see [Committing A Transaction In Single-Phase and Multi-Phase](https://msdn.microsoft.com/library/74b3cfe1-d33a-45b8-91f4-dfd6f6598c4d).
Therefore, on this enlistment of the resource manager, either the <xref:System.Transactions.ISinglePhaseNotification.SinglePhaseCommit%2A> method is called, or the two phase commit methods defined in the <xref:System.Transactions.IEnlistmentNotification> interface are called.
Your implementation of this method should call either the <xref:System.Transactions.SinglePhaseEnlistment.Committed%2A> method or the <xref:System.Transactions.SinglePhaseEnlistment.Aborted%2A> method of the `singlePhaseEnlistment` parameter to indicate whether the transaction should be committed or rolled back.
The transaction manager calls this method when there is only one volatile enlistment that supports single phase commit, or when there are zero or more volatile enlistments and one durable enlistment. In the latter case, the volatile enlistments receive <xref:System.Transactions.IEnlistmentNotification.Prepare%2A> notifications for two-phase-commit, and the sole durable enlistment receives a single-phase commit notification.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>