3 Replies Latest reply on Sep 6, 2012 8:04 AM by mircea.markus

    TransactionCoordinator using one phase commit for PESSIMISTIC locking

    dengansh

      Hi,

       

      I noticed that the TransactionCoordinator performs a one phase commit in case PESSIMISTIC locking is used.

       

      I understand that this is meant as an optimisation that can save 1 RPC, because all the locks have already been acquired on each write. This seems totally valid to me if just Infinispan is taking part in the transaction.

       

      In a distributed transaction with multiple XA resources (e.g. Infinispan + database), however, I wonder if this optimisation is going a bit too far? Shouldn't the prepare phase do as much as possible to make it unlikely that the commit phase can fail? We would see HeuristicMixedExceptions and experience data inconsistencies in case the database transaction already has committed successfully...

       

      Am I missing something? Or should this be changed in future Infinispan versions?

       

      Cheers

      Arne