-
1. Re: JBoss 4.0.2 EJB3 Problem catching exception while persis
jonefun Jul 29, 2005 10:51 AM (in response to jonefun)I've been checking the Hibernate docs for the EntityManager and it suggests that the EntityManager should throw exceptions for errors that occur while interacting with the persistence layer see :-
http://docs.jboss.org/ejb3/HibernateEntityManager/reference/en/html_single/index.html#transactions-demarcation-exceptions
So can anybody comment on why the EntityManager does not throw an exception when I attempt to add two entities with duplicate data in a Field marked as Unique. As I stated earlier the EventListener and AbstractBatchers catch the exception and the JDBCExceptionReporter logs the exception, but that is no use to me when I need to deal with the exception in my StatelessSessionBean.
Any comments ? -
2. Re: JBoss 4.0.2 EJB3 Problem catching exception while persis
triathlon98 Jul 30, 2005 11:47 AM (in response to jonefun)AFAIU the entitymanager will throw these exceptions. However, it is not stated when these exceptions need to be thrown, and they will (in the case of hibernate) only be throws on session.flush and/or tx commit.
Joachim -
3. Re: JBoss 4.0.2 EJB3 Problem catching exception while persis
jonefun Aug 1, 2005 5:01 AM (in response to jonefun)Yes it makes sense for the EntityManager to throw the exception after a flush executes. However it appears that in this situation an exception is not being thrown by the EntityManager.
Question : Is this a bug ? If it is, how do I flag it to the powers that be ?
Jonathan