1. The API Javadoc for refresh() warns that using the session.refresh() method to maintain long conversations is not recommended. Why not? What are the main concerns?
2. I intend to use refresh() conversationally, though I doubt the conversations will be all that long. Basically, to reattach to an entity that is backing a table-row (or any other control), if the application user selects its values from the table for editing.
This strikes me as less risky than using update() or a merge() -- there is a possibility that the database may be directly updated through another application not using hibernate. I do not want to overwrite or lose those changes, slight as the possibility seems.
Even if you think I should be using a different strategy for 2. (like optimistic concurrency with versioning) I would still like to know the specific reasoning behind 1., the Javadoc warning.
|