The following code and text is from page 332 of EJB 3 In Action:
public Item undoItemChanges(Item item) {
entityManager.refresh(entityManager.merge(item));
return item;
}
"The merge operation is performed first in the undoItemChanges method because the refresh method only works on managed entities."
Because of this, I get the impression that the refresh() method does not attach the entity to the persistence context.
.... and Tyronne Fernando is my real name