Class TwoPhaseCommitTool
A utility for executing 2-phase commit on several objects.
This is a Lucene.NET EXPERIMENTAL API, use at your own risk
Inheritance
System.Object
TwoPhaseCommitTool
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Index
Assembly: Lucene.Net.dll
Syntax
public sealed class TwoPhaseCommitTool
Methods
| Improve this Doc View SourceExecute(ITwoPhaseCommit[])
Executes a 2-phase commit algorithm by first PrepareCommit() all objects and only if all succeed, it proceeds with Commit(). If any of the objects fail on either the preparation or actual commit, it terminates and Rollback() all of them.
NOTE: It may happen that an object fails to commit, after few have already successfully committed. This tool will still issue a rollback instruction on them as well, but depending on the implementation, it may not have any effect.
NOTE: if any of the objects are null
, this method simply
skips over them.
Declaration
public static void Execute(params ITwoPhaseCommit[] objects)
Parameters
Type | Name | Description |
---|---|---|
ITwoPhaseCommit[] | objects |
Exceptions
Type | Condition |
---|---|
TwoPhaseCommitTool.PrepareCommitFailException | if any of the objects fail to PrepareCommit() |
TwoPhaseCommitTool.CommitFailException | if any of the objects fail to Commit() |