users@glassfish.java.net

Re: Unique Constraint Question

From: <glassfish_at_javadesktop.org>
Date: Wed, 05 Sep 2007 18:51:38 PDT

I ended up just doing a query for the username (my unique field) and throwing an application specific exception if it already exists.

It works fine, but I think the spec writers missed a pretty big one here. There should be a constraint violation exception with sufficient detail to identify the object in question and the constraint that was violated, and this exception should be able to be caught by the session bean.

Thanks, Marina.
[Message sent by forum member 'rickhoro' (rickhoro)]

http://forums.java.net/jive/thread.jspa?messageID=234137