1 Reply Latest reply on Sep 3, 2008 8:00 AM by nickarls

    OptimisticLockingException & ICEfaces won't redirect

      I'm using ICEfaces with the manual flush workaround to handling of of the partial submit issue (JIRA 3330). I've added the annotation @Version to a timestamp field in the table I'm working with. I bring up two browser windows and select the same record for editing in both windows. I change a value and save the record in one window. Then, I change a value and request a save in the other window to cause an OptimisticLockException. Because study of the resulting stack trace also showed org.hibernate.StaleObjectStateException, I added that exception to the seam-gen'd pages.xml file so it includes:

          <exception class="javax.persistence.OptimisticLockException">
              <end-conversation/>
              <redirect view-id="/error.xhtml">
                  <message>Another user changed the same data, please try again</message>
              </redirect>
          </exception>

          <exception class="org.hibernate.StaleObjectStateException">
              <end-conversation/>
              <redirect view-id="/error.xhtml">
                  <message>Another user changed the same data, please try again</message>
              </redirect>
          </exception>
         
      Instead of being redirected anywhere, the second window just continues t9o show the "in process" indicator after the stacktrace has been logged.

      The log for this segment is over 1250 lines long. I've tried to include some of it, but get a validation error trying to post it.