[jboss-user] [EJB/JBoss] - Re: Bean method called from within transaction cannot open c
branez
do-not-reply at jboss.com
Thu Jan 3 13:31:58 EST 2008
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
More information about the jboss-user
mailing list