mveitas wrote:
Your code needs to synchronize its value with the database
Perhaps I wasn't clear on my question. Say I have code like this:
Cat cat = session.load(Cat.class, id);
// cat.getName() is modified in the database
String name = catgetName(); // Will this return the original name or the new name found in the database?
You said I should synchronize the object state with the database. How does one go about doing that? Are you should I should call session.load() again? Is there a way to detect whether an object state is stale or not without actually clobbering its value?
Thanks,
Gili