This will only work for EntityExistsException due to primary key constraint. The situation I encountered is with a unique constraint on other columns which are not primary keys.
I used the setter methods to set some field values, and then handled both InvalidStateException to retrieve all of the InvalidValue-s, and EntityExistsException to know if a unique constraint has been violated. The problem is that in the catch block of the EntityExistsException, I couldn't query and extract which field's uniqueness the update tried to violate. The only solution I did find was to receive another instance of the (same) bean (from itself), and invoke a REQUIRES_NEW method on that other instance which does the query. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4047115#4047115 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4047115 _______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
