0 Replies Latest reply on Jul 2, 2004 10:39 AM by Pablo Bendersky

    Catching TransactionRolledbackException

    Pablo Bendersky Newbie

      I have a session bean with a method
      void updateCountry(CountryValue value)

      This method will instantiate a Country bean (with the primary key) and then call the setCountryValue method on the Country bean.

      Country is mapped as CMP, and the table has some unique constraints.
      If the data fails to be inserted on the DB (i.e. the unique constraint fails), I get a TransactionRolledbackException logged on the screen.

      My question is:
      How can I catch that exception in the updateCountry method?
      I have a catch for FinderException, NamingException and Exception, and it is not catching it. It seems to me that the exception is being thrown inside JBoss, and I cannot get it on the beans. How can I achieve that?
      My setCountryValue method is abstract, and is the one that XDoclet automatically generates for me.

      Thanks in advance!