But there is still an open question mentioned in the section "Introduction into the Two-Phase-Commit protocol". What to do, if "Phase 2" failed for a transaction branch?
但是“两阶段提交协议简介”小节中提到仍然存在一个问题,那就是如果第2阶段中一个事务分支发生故障,该怎么办呢?
They abort and rollback the transaction if one or more participants failed in the prepare phase.
如果在准备阶段有一个或多个参与者失败,则终止或回滚该事务。
In the prepare phase, the coordinator sends a message to each process in the transaction, asking each process to prepare to commit.
在准备阶段中,协调程序将消息发送到事务中的每个流程,并请求每个流程准备提交。
Phase Commit: an application participating in a distributed transaction has to delay its updates at first.
两阶段提交:首先参与分布式事务的应用程序必须延缓自身的更新。
Now, before the transaction is finally committed the client advises the participating database to prepare the commit (Phase 1).
现在,在最终提交该事务之前,客户机通知参与的数据库准备提交(第1阶段)。
This situation is not necessarily incorrect, but it may force more expensive two phase commit coordination of the transaction.
这种情况不一定不正确,但可能会强制使用开销更大的事务两阶段提交协作。
If the application is not prepared to send the commit of "Phase 2" again the transaction branch will be aborted by a heuristical rollback initiated by the engine.
如果应用程序没有准备重新发送“第 2阶段”的提交,该事务分支将被引擎所启动的试探性回滚中止。
This example scenario is broken down by each phase of the transaction with details of the steps within each phase.
我们以事务的每个阶段分析这个示例情形,并详细讲述每个阶段中的步骤。
As mentioned in section "Introduction into the Two-Phase-Commit protocol" an XA transaction contains two elements which define the transaction.
正如“两阶段提交协议简介”小节中提到的,XA事务包含定义该事务的两个元素。
If the client receives an "okay" from the databases the client sends the order to commit the transaction to the databases (Phase 2).
如果客户机从数据库收到一条“okay”,就发出命令向数据库提交该事务(第2阶段)。
Depending on caching strategy, it might also register for the phase zero protocol to flush log messages upon transaction completion.
根据不同的缓存策略,它可能还需要注册阶段0协议来将日志消息存储到数据库中在事务完成之前。
Then, roll back all the transaction IDs that are in the "prepared" phase
然后回滚“准备”阶段中的所有事务ID
In phase 2 (commit phase), WebSphere transaction manager skips the communication with this resource manager, and it will not disk force or log any activities related to this resource manager.
在阶段2(提交阶段)中,WebSphere事务管理程序略过与资源管理程序的通信,并且它并不冒险强制或记录任何与这个资源管理程序相关的活动。
Transactional support specifies whether the invocation is transactional and, if so, the type of transaction (Atomic (two phase commit) versus Business transaction, or otherwise).
事务支持定义了调用是否是事务性的,如果是的话,是什么事务类型(原子性的(两阶段提交)还是商业事务,或是其它)。
WebSphere transaction manager sends the prepare request to all the resource managers in XA phase 1 (prepare phase) in a WebSphere global transaction.
WebSphere事务管理程序发送预请求给所有在WebSphere全局事务内xa阶段1(预阶段)中的资源管理程序。
It also enables a single one-phase capable resource manager to be used within a transaction in the absence of any other transactional resource managers.
在缺乏其它任何事务资源管理器的事务内部,它也允许使用具有单一的单阶段能力的资源管理器。
If another resource becomes involved in the transaction, you have forced an unnecessary two-phase commit, causing an additional prepare flow.
如果在事务中涉及另一项资源,就会强制进行不必要的两阶段提交,导致额外的准备流程。
It also enables a single one-phase capable (Local transaction) resource manager to be used within a transaction in the absence of any other resource managers.
它还允许在事务中没有任何其他资源管理器的情况下使用一个具有单阶段功能的(本地事务)资源管理器。
The implication of only local transaction support is that only a flat transaction model (one-phase commit) is supported.
仅本地事务支持的含义是仅支持单调事务模式(提交的一个阶段)。
A global transaction can span multiple resources with two-phase commit.
全局事务可以通过二阶段提交跨越多个资源。
Prior to the two-phase commit process, all work performed during the transaction is said to be in-flight, and failure during this period will lead to a rollback of work.
在两阶段提交进程之前,事务过程中执行的所有工作都被认为是“在处理中”,并且在此期间如果失败将会导致工作回滚。
This process effectively delegates transaction coordination to the one-phase commit resource.
此过程有效地指派了对单阶段提交资源的事务协作。
Two-phase commit ensures that a distributed transaction can always be committed or always rolled back, even if parts of the system crash while the transaction is being committed.
两阶段提交确保了分布式事务也可以始终提交或者始终回滚,即使在事务提交过程中系统的一部分崩溃,也不会受到影响。
Two-phase commit gives the transaction manager power to ensure that all resources that participate in a transaction commit or rollback together.
二阶段提交让事务管理者有能力确保所有参与事务的资源都一起提交或回滚。
The updates only become hardened once the transaction manager initiates the two-phase commit process.
只有在事务管理器启动两阶段提交进程时,更新才会变得确定。
This is because the EJB container cannot commit a one-phase commit resource together with two-phase commit resources in a global transaction.
这是因为在全局事务中ej b容器不能同时提交单阶段提交资源和两阶段提交资源。
XA transaction — a resource adapter that can participate fully in a two-phase commit process, and which can influence the outcome of the global transaction.
xa事务——可以完全参与两阶段提交进程的资源适配器,该资源适配器可以影响全局事务的结果。
Many, but not all, distributed transaction implementations use two-phase commit.
有许多(但不是全部)分布式事务的实现使用两阶段提交。
This is particularly true when transactions are widely distributed to business partner systems that may or may not be capable of participating in a standard, two-phase commit transaction.
当事务广泛地分布在也许能或也许不能参与标准的、两阶段提交事务的商业伙伴系统时是尤其正确的。
If it detects that all the resources involved in the transaction are the same, it can skip the two-phase commit and let the resource manager handle the transaction by itself.
如果它检测出所有与事务相关的资源都一样,它可以跳过两阶段提交并让资源管理器自己来处理事务。
应用推荐