[jboss-user] [JBoss Seam] - detached entity passed to persist

quilian do-not-reply at jboss.com
Wed Apr 25 09:20:17 EDT 2007


Hello Folks!

in the examples it looks all so easy, but i still dont get it right.

What are the possible reasons for this exception to occur?
javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist

I dont call em.persist nor em.merge or anything. i just want to edit that @DataModelSelection annotated entity in a form and have it persisted.
I saw at least two possible solutions to get the right object:
@DataModelSelection 
Entity selectedEntity;

in the booking example HotelBookingAction.java:

  |    @In(required=false) @Out
  |    private Hotel hotel;
  | 
  | 
  |    @Begin
  |    public void selectHotel(Hotel selectedHotel)
  |    {
  |       hotel = em.merge(selectedHotel);
  |    }
  | 

however both of these option lead to the same error. 

So again: what are the reasons for the PersistentObjectException to occur?

Thanks for any hints.
Tobias Kilian

PS: i know this is ejb stuff, so perhaps i should ask there?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040580#4040580

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040580



More information about the jboss-user mailing list