2 Replies Latest reply on Aug 23, 2016 8:45 AM by Manuel Uberti

    Handle exceptions in compensate

    Manuel Uberti Newbie

      Hi,

       

      following the travel-agent quickstart, I'm trying to understand how to deal with exception during the transactions workflow. I'm especially interested in failures during the compensation.

       

      I am using WildFly 10.0.0.Final and Narayana 5.3.4. I have set up a project on github: https://github.com/manuel-uberti/narayana-test

      There you can find the class CancelNarayana.java: https://github.com/manuel-uberti/narayana-test/blob/master/MDW/mdw-ejb/src/main/java/com/buddybank/mdw/ejb/service/CancelNarayana.java

       

      I am throwing a RuntimeException on purpose, just to see how I can use Narayana to deal with it. As of now, everything stops, meaning the client included in the repository shows the exception thrown in the EAR.

       

      Is this the default behaviour or is there a way to keep trying until the transaction goes on correctly?

       

      Thank you.