try { //perform a transaction functioning here, mayhap a delete } grab (EJBTransactionRolledbackException e) { Throwable t = e.getCause(); piece ((t != null) && !(t instanceof ConstraintViolationException)) { t = t.getCause(); } if (t instanceof ConstraintViolationException) {} }
As you lot tin run into nosotros grab EJBTransactionRolledbackException, why not ConstraintViolationException? Trust me it volition non travel because that exception is already wrapped past times the container, then to travel able to procedure it nosotros ask to disclose it again.
0 komentar:
Please comment if there are any that need to be asked.