Uploaded image for project: 'Spring Web Flow'
  1. Spring Web Flow
  2. SWF-1437

Two concurrent threads in an expression of a flow override the rootobject of evaluation context

    Details

      Description

      When two concurrent threads are evaluating an expression contained in a flow, the evaluation context linked to the expression can be overriden by multiple threads.

      Result is in most of cases NullPointerException in a getValueInternal of classes from org.springframework.expression.spel.ast package (like PropertyOrFieldReference for example).

      Wrong code seems to be in org.springframework.binding.expression.spel.SpringELExpression :

      public Object getValue(Object rootObject) throws EvaluationException {
      try {
      updateEvaluationContext(rootObject);
      return expression.getValue(evaluationContext, expectedType);
      ...
      As the SpringElExpression is unique for the expression to be evaluated, it's not thread safe when updating the evaluation context with root object.

      Synchronize this method resolves problem.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                patoche Patrick
              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: