-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: keep original user-input after a StaleObjectStateException
PostPosted: Mon Dec 31, 2007 12:33 pm 
Beginner
Beginner

Joined: Mon Apr 24, 2006 10:42 am
Posts: 23
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.