0 Replies Latest reply on Mar 14, 2006 9:59 AM by shahzad bhatti

    jBPM for distributed transactions

    shahzad bhatti Newbie

      I am looking into jBMP to implement distributed transactions. We are not using any kind of XA or global transactions, instead each of our service has an undo API that we use for compensating transaction. For example, currently our code looks like this:
      try {
      AirServiceQueue.send("BUY", ....);
      AirServiceQueue.receiveAck(timeout);
      } catch (Throwable e) {
      AirServiceCancelQueue.push(...);
      }
      try {
      CarServiceQueue.send("BUY", ....);
      CarServiceQueue.receiveAck(timeout);
      } catch (Throwable e) {
      AirCancelQueue.push(...);
      CarCancelQueue.push(...);
      }
      try {
      HotelServiceQueue.send("BUY", ....);
      HotelServiceQueue.receiveAck(timeout);
      } catch (Throwable e) {
      AirCancelQueue.push(...);
      CarCancelQueue.push(...);
      HotelCancelQueue.push(...);
      }
      try {
      CreditCardServiceQueue.send("BUY", ....);
      CreditCardServiceQueue.receiveAck(timeout);
      } catch (Throwable e) {
      AirCancelQueue.push(...);
      CarCancelQueue.push(...);
      HotelCancelQueue.push(...);
      CreditCardQueueCancelQueue.push(...);
      }

      I would like to extract this logic and define workflow using something like jBPM. However, I have never used jBMP. My first question: can jBMP do something like this efficiently and declartively. Second question: are there best practices or samples available to accomplish this.
      Thanks in advance.
      Regards,
      Shahzad Bhatti