This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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)) ??
SCJP 5 (76%)
SCWCD 5 (86%)
"The greatest glory in living lies not in never falling, but in raising every time we fall.".. Nelson Mandela