My point is that this:
carInfo= session.load(..., id);
session.update(carInfo);
session.flush();
Works just fine. So I have the object in persistence context, I'm calling update on it, and all is well. What I don't understand is why this:
carInfo= session.load(..., id);
session.evict(carInfo);
carInfo=session.load(...,id);
session.update(carInfo);
session.flush();
Does not work? If evict removes object from persistence context, and load puts it right back there, then what's the problem? evict and load should even out each other, and I should be back to my initial scenario, with object stored in persistence context and ready for update.
|