1 2 3 Previous Next 39 Replies Latest reply on Dec 22, 2008 8:19 AM by janvandeklok Go to original post
      • 30. Re: Problem with a decision node in a fork,join construct.
        erciped

        We are having the same problem. Has anyone tried other options like

        optimistic-lock="false"

        on some of the relationships between token and the other tables? The children relationship looks suspect in that is a child Token gets removed or added, the version of the parent Token is incremented. This could possibly cause lots of StaleObjects during transitions in sub processes say if I understand the data model correctly.

        Also, has anyone tried

        <class name="Token" table="TOKEN" optimistic-lock="all">

        or

        <class name="Token" table="TOKEN" optimistic-lock="dirty">

        thus removing the version column altogether and using the values of columns in memory to detect a clash?

        The Hibernate docs say using a "version" column is preferred but these other strategies may solve the problem if not elegantly.

        • 31. Re: Problem with a decision node in a fork,join construct.
          mputz

          Ronald, thanks for the unit test. I executed it against mysql, postgres and oracle (the real ones and not just h2 in the different modes to be sure), and here is what I've found:

          + " <join name='join'>" /* the default: leads to StaleObjectStateException with Oracle and Postgres */
          //+ " <join name='join' lock='"+ LockMode.UPGRADE.toString() + "'>" /* works */
          //+ " <join name='join' lock='"+ LockMode.UPGRADE_NOWAIT.toString() + "'>" /* works */
          //+ " <join name='join' lock='"+ LockMode.NONE.toString() + "'>" /* works */
          //+ " <join name='join' lock='"+ LockMode.READ.toString() + "'>" /* works */
          //+ " <join name='join' lock='"+ LockMode.WRITE.toString() + "'>" /* invalid lock mode */
          //+ " <join name='join' lock='"+ LockMode.FORCE.toString() + "'>" /* StaleObjectStateException */
          


          So, setting the LockMode seems to be a valid workaround to fix this on Oracle and Postgres.

          Btw, I have also tried to change the generator type, but that didn't help (besides that this is not compatible to the various dbs).

          Are you going to check in your unit test?

          • 32. Re: Problem with a decision node in a fork,join construct.
            janvandeklok

            Martin,
            can we set the lock attribute in the processdefinition.xml?? Not according to the documentation imho.


            Jan

            • 33. Re: Problem with a decision node in a fork,join construct.
              kukeltje

              @Jan,
              Yes, the lock can be on the processdefinition. If it complaints and you have a reference to the xsd, remove that.... validating against the xsd does not work then. (also a jira issue might be created then for the xsd to be updated)

              @Martin.. Yes, I'd like to but I get 403's when committing. Someone has to fix that and I don't know who (already informed Tom)

              The generator type was just to see if postgress would work then and kind of confirm it has a releation to generated-id's (via sequences) or auto-increment one. It was never meant to be changed indefinately

              On a sidenote, If I add the flush back in the code, my H2 oracle compatible db does not lead to any errors as without it I get a SOE

              The strange thing is that UPGRADE and FORCE (the default if nothing is provided) are kind of similar for hibernate. FORCE also working for not versioned objects... strange. Maybe one of the JBoss Hibernate experts could have a look.

              • 34. Re: Problem with a decision node in a fork,join construct.
                kukeltje

                @erciped:

                No, and I can't (at least not against a real Oracle or PostgreSQL). I agree that the issue seems to be in that direction. Can you give it a try?

                • 35. Re: Problem with a decision node in a fork,join construct.
                  janvandeklok

                  To All,

                  Specifying the lock="UPGRADE" on the join node does the trick!!

                  Even without the call to session.flush() in the join class.

                  I want to thank all of you for your great support!!!
                  Hopefully the fix for this bug can be included in the next release.

                  Thanks again!

                  Jan

                  • 36. Re: Problem with a decision node in a fork,join construct.
                    kukeltje

                    Thanks for reporting back... for me it would not be the solution, but we could chance the default for oracle to 'upgrade' if de process is parsed. Otoh, maybe just a 'known-issue' regarding these specific processdefinition cases would be better. I hate putting db/as/jdk specific code in my classes

                    • 37. Re: Problem with a decision node in a fork,join construct.
                      janvandeklok

                      Ronald,
                      i've send you an email using ronald@jbpm.org. Do you still use that email address??

                      • 38. Re: Problem with a decision node in a fork,join construct.
                        kukeltje

                        Yes, I've seen it. I'll respond later today

                        • 39. Re: Problem with a decision node in a fork,join construct.
                          janvandeklok

                          Hi all,

                          Although the lock="UPGRADE" without the session.flush() solves the problem in 3.3.0.GA, the same solution in version 3.2.3 does not work.

                          For our company this is not a problem, we can switch to 3.3.0.GA easily since we do not run production right now.

                          I thought this was valuable information to share.

                          Jan

                          1 2 3 Previous Next