2phase-commit

How does three-phase commit avoid blocking?

半城伤御伤魂 提交于 2019-12-04 09:00:21
问题 I am trying to understand how three-phase commit avoids blocking Consider the following two failure scenarios: Scenario 1: In phase 2 the coordinator sends preCommit messages to all cohorts and has gotten an ack from all except cohort A. Network problems prevent cohort A from receiving the coordinator's preCommit message. Cohort A times out waiting for the preCommit message and chooses to abort. Then both the coordinator and cohort A crash. Scenario 2: The protocol reaches phase 3. The

Last Resource Optimization

。_饼干妹妹 提交于 2019-12-03 22:45:49
问题 I'm writing a Resource Adaptor which does not support two phase commit. I know there is an optimization technique called: "Last Resource Optimization". On JBoss your XAResource class should implement LastResource in order to have the optimization. My question is: how this can be done in WebLogic, WebSpehre, Glassfish, etc... 回答1: Weblogic: AFAIK (may be very wrong) only JDBC drivers can be used with LRO, and it's a purely administrative task . When a driver doesn't support XA, it can be

How does three-phase commit avoid blocking?

江枫思渺然 提交于 2019-12-03 01:38:05
I am trying to understand how three-phase commit avoids blocking Consider the following two failure scenarios: Scenario 1: In phase 2 the coordinator sends preCommit messages to all cohorts and has gotten an ack from all except cohort A. Network problems prevent cohort A from receiving the coordinator's preCommit message. Cohort A times out waiting for the preCommit message and chooses to abort. Then both the coordinator and cohort A crash. Scenario 2: The protocol reaches phase 3. The coordinator sends a doCommit message to cohort A. But before it can send more doCommit messages the

Delivery of JMS message before the transaction is committed

雨燕双飞 提交于 2019-11-27 12:47:13
I have a very simple scenario involving a database and a JMS in an application server (Glassfish). The scenario is dead simple: 1. an EJB inserts a row in the database and sends a message. 2. when the message is delivered with an MDB, the row is read and updated. The problem is that sometimes the message is delivered before the insert has been committed in the database. This is actually understandable if we consider the 2 phase commit protocol: 1. prepare JMS 2. prepare database 3. commit JMS 4. ( tiny little gap where message can be delivered before insert has been committed) 5. commit

Delivery of JMS message before the transaction is committed

混江龙づ霸主 提交于 2019-11-26 16:07:41
问题 I have a very simple scenario involving a database and a JMS in an application server (Glassfish). The scenario is dead simple: 1. an EJB inserts a row in the database and sends a message. 2. when the message is delivered with an MDB, the row is read and updated. The problem is that sometimes the message is delivered before the insert has been committed in the database. This is actually understandable if we consider the 2 phase commit protocol: 1. prepare JMS 2. prepare database 3. commit JMS