[jboss-user] [EJB 3.0] - Re: relationship does not prevent from deleting referenced e

micho do-not-reply at jboss.com
Thu Feb 22 08:26:38 EST 2007


I try to detect the constraintviolation now via

catch (RuntimeException e)
  | { if (e.getCause().getCause().getCause().getClass().toString().equals("class org.hibernate.exception.ConstraintViolationException") )
  |   { DO SOMETHING

is that OK?

But there are two things I don´t understand.
1) why are there two identical exceptions? Is that a problem?
2) I guarded the call of the remove request with a try-catch block, but the exception is not cougth in this catchblock

  | try
  | { em.remove(deleteBg);
  | }
  | catch (Exception e)
  | { logger.error("...

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020550#4020550

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4020550




More information about the jboss-user mailing list