Hi all,
I am using Hibernate 3.2.5 with long-sessions, and I would like to provide the following handling of StaleObjectStateException: I would like to give the user the option to return to the submitted page, so they can make a copy of their data (i.e. copy to a text file or whatever...). Sometimes, the user may have taken a long time to enter their data, and I would like to give them an opportunity to salvage it.
Since I am using long-sessions (i.e. conversations), I thought I should be able to keep using the session after the failed commit attempt, and by calling session.get() again, I thought I will get my original object (the one that contains the user's data). However, what seems to happen is that upon flushing and committing, the Session's PersistenceContext is cleared, and so the data is lost.
Is there any way to retrieve the stale-object *after* the StaleObjectStateException?
Thanks,
Naaman
|