Hi Guys,
with hibernate 3.2 RC I used to use detached entities and send them back and forth across the boundary between my ejb layer to my web layer (from session bean to jsf managed bean) like value objects. It worked really well, and I just did an entityManager.refresh(myEntity) before working with it to reattach it.
Now, when I do an entityManager.refresh(myObject) on an object that has previously been persisted by hibernate, but detached to the web layer and sent back to be reattached...it throws the following exception
Caused by: java.lang.IllegalArgumentException: Entity not managed
at org.hibernate.ejb.AbstractEntityManagerImpl.refresh(AbstractEntityManagerImpl.java:260)
at com.sun.enterprise.util.EntityManagerWrapper.refresh(EntityManagerWrapper.java:783)
Which I discovered is related to jira ticket #EJB-205 (
http://opensource.atlassian.com/project ... se/EJB-205)
So, my question is...now that you can't use refresh to reattach a detached object, what is the correct way to do it?
Cheers
Adam