3 Replies Latest reply on Feb 1, 2006 5:41 AM by manik

    two-phase commit protocol in jbosscache1.2.3

    stelang

      Is this protocol used if transaction support is disabled, i.e. equivalent to setting AutoCommit to on where modifications are replicated after every change? Thanks

        • 1. Re: two-phase commit protocol in jbosscache1.2.3
          brian.stansberry

          No, two-phase commit is not used. Modifications will be replicated after every change, but there is no guarantee that they will be applied consistently across the cluster if transactions are not used.

          Exactly what will happen depends on the cache mode.

          If REPL_ASYNC, the replication message is fire-and-forget. The initiating cache instance has no idea if the other caches were able to apply the update.

          If REPL_SYNC, the initiating cache receives responses from the other caches indicating if they were able to apply the update. If any weren't, a ReplicationException is thrown. However, 2PC semantics are not in place; this exception does not cache a rollback of the update to the cache, neither on the initiating cache nor on any remote caches that were able to successfully apply the update.

          • 2. Re: two-phase commit protocol in jbosscache1.2.3
            stelang

            So , in case of REPL_SYNC, if a ReplicationException is thrown and since this exception does not cache a rollback of the update to the cache, neither on the initiating cache nor on any remote caches that were able to successfully apply the update, is there any api available in JBossCache1.2.3 to rollback these changes, on catching the exception in the code? Thanks.

            • 3. Re: two-phase commit protocol in jbosscache1.2.3
              manik

              Nope. If you need to maintain integrity in the event of a failure when using replication, we'd recommend using transactions...