-->
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.  [ 2 posts ] 
Author Message
 Post subject: StaleObjectStateException caused by BACK button
PostPosted: Tue Apr 25, 2006 9:16 am 
Newbie

Joined: Wed Apr 19, 2006 4:25 pm
Posts: 7
Hi, I hope someone out there can help me with this problem. I'm still new to Hibernate so be gentle. Here's my problem….

I have a JSP page with customer data that is managed by Hibernate. There are some text fields where the user can change information (such as phone number, address, etc) in addition to some links that the user can select to drill down into customer-specific information (orders). Since the user may have modified any of the text fields prior to drilling down into the order info, I save the customer data before going on to the next screen.

The problem occurs when the user selects the BACK button on the browser to return to the main customer page from the “drill down” page instead of selecting the CANCEL or SAVE button. Selecting CANCEL or SAVE would cause the main page to refresh itself while selecting the BACK button does not. Obviously the “version” field in the DB is now out of date with the JSP page and any subsequent saves on this page will cause Hibernate to throw a StaleObjectStateException. I already have meta tags in my JSP page for no-cache, but that doesn’t seem to be helping.

Any thoughts?

Thanks for the help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 26, 2006 12:28 am 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I don't know much about webapp stuff, but the code that our UI developers use to prevent this sort of thing is org.apache.struts.action.Action.isTokenValid(HttpServletRequest). Maybe that will give you a lead? Google, do your stuff!


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

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.