JBoss 4.2.2.GA / JDK 6, Seam 2.1.1GA, POJO
I have the unfortunate situation where I persist an entity (let's call it an Order) but a database trigger can throw an exception if the saving is not allowed (due to more complicated DB-related constraints/logic).
When I persist, I can catch the PersistenceException, do a addFacesMessage and wrap it in an @ApplicationException. In pages.xml I have a
<exception class="java.sql.BatchUpdateException"> <redirect view-id="/main.xhtml"> <message>BatchUpdateException</message> </redirect> </exception>
When I persist the entity the following happens
BatchUpdateExceptionmessage. Fine.
The DB exception is fatal for the transaction(?) but is there some form of semi-graceful way of handling this situation?
The RollbackInterceptor correctly notices that no rollback is required
The BijectionInterceptor correctly notices that no ending of conversation is required
But then the ExceptionFilter can't find a Manager (and then goes on the temp conversation route)
Theories?