I'm trying to use the "Consistent Exception Hierarchy" 
(http://www.springframework.org/docs/reference/dao.html#dao-exceptions) of the 
Spring framework to catch errors after updating or saving an entity. For the 
moment, I try to catch problems with <<unique>> attributes where the user fills 
a value already used by another entity. The problem I have, is that those 
constraints seem to be checked at the database level, when the Hibernate 
session is flushed. And from what I see, the session is flushed after the 
"handleXXX()" method returns ...



Is there a way to flush sessions so we can get the exceptions early ? Or even 
better : what pattern do you use to check unique constraints (or other) and 
return better error message ? I dont expect it's very appropriate to write a 
Struts Validator for checking unique constraint ...



Thanks for your help !
_________________________________________________________
Reply to the post : http://galaxy.andromda.org/forum/viewtopic.php?p=1186#1186
Posting to http://forum.andromda.org/ is preferred over posting to the mailing 
list!


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20
_______________________________________________
Andromda-user mailing list
Andromda-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/andromda-user

Reply via email to