[jboss-user] [EJB/JBoss] - Unable to catch Persistence Exception if using EntityManager

kaneshiro.takeshi do-not-reply at jboss.com
Fri Apr 20 06:33:58 EDT 2007


Hi,

I'm using EJB3 with jboss-4.0.5.GA. As usual, i'll use the EntityManager's API to do CRUD operation, such as, em.persist(), em.merge() etc.

The problem here is that it seems like i'm unable to catch database persistence exception in the session bean. I'm only able to catch it in the delegate. All this is due to the behaviour of the container where it doesn't commit immediately. I'm using CMT/CMP.

I've read about using em.flush(), but are there any other way? Because i read that using this will affect the performance. How do you guys catch persistence exception? I need to catch it in the session bean (not the client) so that i'm able to do logging in the back end.

Please advise. Thanks.

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

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



More information about the jboss-user mailing list