[jboss-user] [JBoss Seam] - Re: Exception handling of PersistenceException

dapeng do-not-reply at jboss.com
Fri Nov 23 08:17:46 EST 2007


I am using Seam  in JSF layer  + tx (SeamPhaseListener) and Persistence context management. Spring in the middle layer. and JPA for persistence.

My problem is:
new JSF request, seam starts tx, jsf layer calls spring, which calls JPA daos. Jpa dao executes several statements, the call returns and JSF lifecycle finishes phase 5. SeamPhaseListener commits tx, which causes persistence context to flush (all pending statements collected before). During the flush, some DB error occurs (unique constraint or foreign key constraint). Upon the flush error, tx rollbacks, but my code are already executed at this time (after action method return). I've got no chance to handle the exception besides using a ExceptionHandler. 

Better idea there? 

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

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



More information about the jboss-user mailing list