Problem solved. The error handling in this case could not be accomplished by catching
EntityExistsException, since PersistenceExceptions except for NoResultException and
NonUniqueException mark the transaction for rollback, causing it to be unavailable for the
next iteration of addRootItem(). The existence check had to come first and, if it
doesn't exist, Query.getSingleResult() throws NoResultException, which can then be
handled properly because it does not cause a transaction rollback.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4117653#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...