I have thew following scenario in a Web application: I'm loading a complex object graph, then close the session -- the loaded objects are now detached. The user edits some of the objects. Now I want to persist the saved objects back to the database -- it appears a cascading saveOrUpdate would be the best choice. However, according to the doc, this method will save every object in the graph, regardless of whether it was actually modified (and no, I don't want to use "select before update"). Is there a way for Hibernate to just update objects that have actually been modified? I'm assuming the answer is "no" for detached objects, since I'm guessing the previous state is maintained as part of the 1st level cache, which vanishes as soon as I close the session from which I loaded my objects.
Any ideas?
Thanks!
Jen
|