You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Cheng Wei Lee <zh...@gmail.com> on 2008/01/21 11:43:09 UTC

Struts 2: hibernate optimistic locking - allows user to merge conflicting data

Currently for client/server side validation, struts is able to maintain the
data and shows it to the user, with the error messages and preserved user
input. I'm using Hibernate for persistence. The StaleObjectStateException is
caught inside the filter that I use to set up the Hibernate session. How
would I then be able to get the object that Hibernate tries to persist?

If I take this exception handling into my action class, this would expose
the Hibernate API which I'm trying to avoid.

If I could get the object that causes the exception, how could I then
display to the user both sets of data? The new and conflicting ones? Does
Struts 2 support this type of displaying, or I've to add it in myself?

Thanks!