I have an unique constraint on a column. When I enter a non unique value for the column the server (JBOSS) throws ServerException. I don't have any code in either ejbLoad or ejbStore for the entity. How do I catch this exception?
Work around I am using - check the db using a finder if unique then insert else inform the use.
What is the right way to handle this? I don't like the idea of keeping the constraint and also check using finder.