I've come across this problem before, and pretty much used the same solution to
solve it.
When you move from your edit page to the view page after canceling your
changes, the conversation object itself is re-used, and uses the same entity
manager. The entity manager contains an instance of the object you were just
editing, and therefore when it 'loads' it, it just uses the version it already
has which is dirty.
Add the following to the bottom of your template :
| <h:outputText value="Entity Manager : #{enityManager}"/><br/>
| <h:outputText value="Conversation : #{conversation}"/>
|
You can see how the same instance is used from one page to the next.
So, I just always use explicit saveChanges() and cancelChanges() methods which
either saves the changes, or refreshes the entity. Ending the conversation can
be handled from the @End annotation, or within the pages.xml or the pageflow
depending on the String returned from the method.
I don't use the entity home stuff, but it should work the same.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061546#4061546
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061546
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user