Yes, the merge() detects that item is a not a detached entity and attempts to persist it, and this in turn fails because there is a unique constraint on the name field.
By EJB object do you mean the EJBContext? find() is supposed to fetch the existing entry. It is using the same object that would have been persisted in the database to get name and then pass that to find(). (Sorry I chose a poor name for this example, but find() is what I posted above and is not EntityManager.find() ) View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4116811#4116811 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4116811 _______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user
