2 Replies Latest reply on Oct 4, 2005 4:10 AM by jaikiran pai

    How to recover from rolled back transaction?

    jaap Newbie

      Hi,

      I am using JTA and in a MDB i have the following problem. During the process, in an transaction, a bean encapsualtion a external webservices throws an exception (axis fault). The result is that JBoss rolls back the transaction. But in this case i don't want that. I want to persist with the error state and a error message.
      Side effect is that the MDB does not end 'normally', so it is resubmitted several times until it is send to the DLQ. This for me is a minor issue, but is there a way to tell the MDB it should not be resubmitted to the queue?

      So what is have is this:
      MDB
      onMessage {
      start transaction
      creating/initialising some stuff;
      try {
      requesting external webservice;
      } catch exception (axis fault packed as RemoteException) {
      set error state in persisting class;
      ignore error state for JTA and MDB and resume as planned;
      } finally {
      commit transaction;
      persist;
      }
      }

      So, can anybody tell me how to 'resume' the transaction. I am using Hibernate with JBoss' JTA and i simply do not know how to recover from the rollback state.

      Jaap