3 Replies Latest reply on Jul 17, 2008 6:09 AM by kukeltje

    reason for catching StaleObjectStateException in Service

    twiceknightly

      Hi,

      Could someone tell me the reasoning why StaleObjectStateException is caught in Service.java and only logged but not rethrown? It would seem to me that your own app would always want to catch it. Am I just missing the point?

      Would I have to rebuild from source if I wanted to change service.java?

        • 1. Re: reason for catching StaleObjectStateException in Service
          kukeltje

          afaik (from the forum and jira), there are several situations where and SOSE can occur that have no real influence on the functionality. (Re)throwing the SOSE would make it difficult to decide how to react in your ap. But I might be missing something....

          • 2. Re: reason for catching StaleObjectStateException in Service
            twiceknightly

            I don't pretend to understand all the reasons why such an exception may be thrown. However if two threads are trying to signal a transition on the same process instance and one fails then I would say you do want to know about that.

            Furthermore presumably if a user interface is involved then you would want to give the user some visual indication of why the app now looks to be in a state that is inconsistent with what they expected.

            UI or not surely if there is a failure you want to rollback and not keep the app in an inconsistent state? Just gobbling up the exception and not throwing a new exception just seems plain wrong.

            • 3. Re: reason for catching StaleObjectStateException in Service
              kukeltje

              Some of this has been discussed in the forum. Currently I have no time to search for the articles so I'd suggest you do it (I'd do it for you if I had the time). There is also info in some jira issues related to concurrency. Might be that there is more detailed info about the reasons there.

              Otherwise I'll ping one of the developers to get a statement from them (you can do that yourself if you have a support contract)