1 Reply Latest reply on Feb 15, 2006 9:38 PM by Bill Burke

    Custom Exception

    Luis Gervaso Newbie

      Hello all,

      I'm implementing the logic about persist an entity

      The problem is EntityManager does not throws any exception when I try insert a duplicate row in the database
      The exception is thrown by the Ejb3Tx

      ¿how can i catch this exception in order to create a more descriptive exception for my model?

      example :

      try {
      em.persist(entity)
      } catch (Exception e) {
      // this code never is executed!!!
      }

      when the program counter leaves the method the exception is thrown by ejb3tx

      thanks in advance

      Luis