JPA - saving changes without persist() invoked
问题 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 a user with the given userId . But the 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 100% sure