CatchSandeepVaid (23) [Avatar] Offline
#1
Why can't EntityManager.refresh() work on detatched entities? Any reason behind this ?
CatchSandeepVaid (23) [Avatar] Offline
#2
Re: EntityManager.refresh() works only on managed entities.
Moreover at P-298, the diagram shows refresh() method working on detatched entity... Is that an errata ?
P-331 says : "We use the method to undo changes made by the ItemManager client and return fresh entity data from the database."
but when we call merge() (before refresh()), the changes made by the client will get reflected in the database.

Message was edited by:
CatchSandeepVaid
reza_rahman (456) [Avatar] Offline
#3
Re: EntityManager.refresh() works only on managed entities.
Sandeep,

We appreciate your enthusiasm in reading the book and learning about EJB 3.0/JPA 1.0. However...

Kindly do not cross-post and please take the time to look at previous posts before posing a question that has been asked and answered before (as I believe I have asked you politely more than once at this point on multiple posts).

For reference, we generally follow the JavaRanch etiquette on this forum: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch. We find that it maintains a friendly environment useful to the largest number of readers. The last thing I want to be doing is ignoring, deleting, editing or policing posts of readers genuinely trying to get help in an effort to maintain quality of content...

Thanks for respecting the time and effort of everyone on this forum and all readers of EJB 3 in Action.

Cheers,
Reza