Uploaded image for project: 'Spring Integration'
  1. Spring Integration
  2. INT-3162

Make AbstractScriptExecutor as thread-safe

    XMLWordPrintable

    Details

      Description

      Now it is:

      for (Entry<String, Object> entry : variables.entrySet()) {
           scriptEngine.put(entry.getKey(), entry.getValue());
      }
      

      But it isn't thread-safe, because scriptEngine is shared object and there is no any syncronization around.
      Change it to:

      result = scriptEngine.eval(script, new SimpleBindings(variables));
      

      to raly on fresh SimpleScriptContext for each eval call.

        Attachments

          Activity

            People

            Assignee:
            abilan Artem Bilan
            Reporter:
            abilan Artem Bilan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: