This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help Ejb 3 In Action page 304

 
Mamadou Touré
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Folks,
I`m a little bit confused at page 304 of the EJB3 in action with the code below


The purpose of the code is to undo the changes made on the item, so why don't we just say entityManager.refresh(item), insted of passig again the entityManager.merge(item) as an argument to the refresh method ??

It's the same thing with the second method when it comes to deleting an item ( why domn't we just say entityManager.remove(item) instead of entityManager.remove(entityManager.merge(item)) ??
 
Deepika Joshi
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this thread
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic