3 Replies Latest reply on Sep 2, 2009 11:17 AM by jaikiran

    How to catch JTA/JPA exception?

    gackonac

      Hello!

      Is there a way to catch exception when transaction fail?

      Simple scenario:
      - MDB receives the message
      - onMessage() try DB access (JPA provider is Hibernate)
      - DB operation fails

      onMessage() method returns without exception. Just after it's finished, exception is thrown: javax.transaction.RollbackException (caused by java.sql.*Exception).

      So, I need to (explicitly) handle any exception that might be a cause of transaction failure. Is there any idea how to do that?

      Thanks for your attention!