Programmer Question
here is my code snippet:
@Stateless
public class mySLSB {
@PersistenceContext(unitName = "db")
private EntityManager myEntityManager;
public void crud(MyEntity myEntity) throws MyException {
myEntityManager.merge(myEntity);
}
}
However this merge can cause a ConstraintViolationException, which does not throw MyException (which is caught in the calling servlet).
What is the best way to catch hibernate exceptions ?
Find the answer here
No comments:
Post a Comment