Hi,
we are using Toplink implementation of JPA + Spring + EJB. In one of our EJBs we have something like this:
public void updateUser(long userId, String newName){
User u = em.get(User.class, userId);
u.setName(newName);
// no persist is invoked here
}
So, basically this updateUser method is supposed to update the name of user with given id. But author of this method forgot to invoke em.persist(u);
And the strangest thing is that it works fine. How can it be? I was a 100% sure that without invoking em.persist() or em.merge() there is no way that changes could have been saved into database. Could they? Is there any scenario when this could happen?
Thanks