[jboss-user] [JBoss Seam] - Re: Merging objects problems.
bfo81
do-not-reply at jboss.com
Fri Aug 25 07:15:24 EDT 2006
There's something important I forgot to mention:
You might think that a group gets newly created here:
@In(create=true) @Out @Valid
| private Group group;
But that's wrong, it already exists:
org.hibernate.PersistentObjectException: DETACHED (!!!!!!!!!!!!!!) entity passed to persist:
group is definitely a MANAGED object, that was read via em.find or em.createQuery()... and then got DETACHED during Seam bijection. The only entites that are able to be persisted are those of state NEW/TRANSIENT or REMOVED. That's why em.persist() didn't work. Then you tried em.merge(), which led to an update of an existing group instead of creating a new one.
And the second thing: I didn't exactly understand what's behind your register bean (I'd be interested in the JSF file). Only then we can say if the bean should be stateless or stateful ;).
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967446#3967446
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967446
More information about the jboss-user
mailing list