The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

CatchSandeepVaid (23) [Avatar] Offline
Why can't EntityManager.refresh() work on detatched entities? Any reason behind this ?
CatchSandeepVaid (23) [Avatar] Offline
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:
reza_rahman (456) [Avatar] Offline
Re: EntityManager.refresh() works only on managed entities.

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: 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.