public final class TwoPhaseCommitTool extends Object
|Modifier and Type||Class and Description|
|Modifier and Type||Method and Description|
Executes a 2-phase commit algorithm by first
public static void execute(TwoPhaseCommit... objects) throws TwoPhaseCommitTool.PrepareCommitFailException, TwoPhaseCommitTool.CommitFailException
TwoPhaseCommit.prepareCommit()all objects and only if all succeed, it proceeds with
TwoPhaseCommit.commit(). If any of the objects fail on either the preparation or actual commit, it terminates and
TwoPhaseCommit.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.
TwoPhaseCommitTool.PrepareCommitFailException- if any of the objects fail to
TwoPhaseCommitTool.CommitFailException- if any of the objects fail to
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.