[jboss-user] [JBoss Seam] - Re: Recovering from a Constraint violation exception

2007-09-19 Thread wise_guybg
If you put it this way then yes... your solution seams good. But I would like to have the check only once. Say as a DB constraint. Otherwise I'll be doing twice the same verification. Sometimes it's easier and faster to implement a db constraint and if you try to mirror that check in the code i

[jboss-user] [JBoss Seam] - Re: Recovering from a Constraint violation exception

2007-09-19 Thread supernovasoftware.com
I have many many database constraints. I am just checking for possible errors before they happen. If they do then the user gets a nice message. If I for got to check one and it fails the users cry and I quickly add it so they are not hosed by an error screen. View the original post : http:/

[jboss-user] [JBoss Seam] - Re: Recovering from a Constraint violation exception

2007-09-19 Thread wise_guybg
fernando_jmt: Could you please post a link of the topic you're talking about. I couldn't find it in the forum. supernovasoftware.com: Manual and Hibernate Validation are one thing. Database constraints are another thing. Currently I have a problem handling exceptions from the database. One coul

[jboss-user] [JBoss Seam] - Re: Recovering from a Constraint violation exception

2007-09-18 Thread supernovasoftware.com
I do this validation manually and add a message to that control if the value already exists. I am not using Hibernate Validator at all. In every action that requires validation, I do this. This handles all complex cases that I have come across. Does anyone know if it is possible to bind a met

[jboss-user] [JBoss Seam] - Re: Recovering from a Constraint violation exception

2007-09-18 Thread fernando_jmt
I do use a Action + Service pattern in order to catch all EJB/JPA exceptions and stay in the same page or display a pretty nice error messages. The action is a simple POJO and the Service is an @EJB , @TransactionAttribute(REQUIRES_NEW) over the method makes me happy in this case. IIRC, I've a