Thanks. I found this post that solve the problem. http://stackoverflow.com/questions/1390008/delete-a-hibernate-entity-with-tapestry5-gives-a-different-object-with-the-sa
Using @Persist( "entity" ) Persists the hibernate object when the input comes back to the user. On Thu, Sep 12, 2013 at 9:12 AM, Lance Java <lance.j...@googlemail.com>wrote: > I think the issue is because mOrder is not connected to the hibernate > session. > > It looks like you are only saving the entity when the user clicks "accept". > I'm guessing that at some stage before you are submitting a form and > storing mOrder on the HttpSession? > > If I were you, I'd try to remove HttpSession usage completely. Is it > possible to do 2 saves to the database with different states (perhaps > "saved" then "accepted") > > If you still really want to use the HttpSession, you'll need to attach > mOrder to the current hibernate session before saving. This can be done via > session.merge(mOrder); >