Hello all

Grzegorz as u wrote...

Therefore I would like to propose introduction of a new scope called "request-inheritable" which
would allow beans (like ObjectModel) to be inherited but by cloning.

can you please elaborate on that ... coz thats where we are stuck ... if u have a look at the AbstractInterpreter.java file

public void forwardTo(String uri, Object bizData,
                         WebContinuation continuation,
                         Redirector redirector)
   throws Exception {
       if (SourceUtil.indexOfSchemeColon(uri) == -1) {
           uri = "cocoon:/" + uri;
final Map objectModel = this.processInfoProvider.getObjectModel(); FlowHelper.setWebContinuation(objectModel, newObjectModel, continuation); FlowHelper.setContextObject(objectModel, newObjectModel, bizData);
           if (redirector.hasRedirected()) {
throw new IllegalStateException("Pipeline has already been processed for this request");
           }
           // this is a hint for the redirector
           objectModel.put("cocoon:forward", "true");
           redirector.redirect(false, uri);
       } else {
throw new Exception("uri is not allowed to contain a scheme (cocoon:/ is always automatically used)");
       }
} so the instance of newObjectModel is the one from the bean factory ... and if u have multithreading then all the threads change that objectmodel simultaneously and then finally the objectmodel coming to the JXTemplategenerator(Injected by spring) is not thread specific ... in the setup method of the generator class we replace the objectmodel injected by spring with the one passed with that method ... after doing this the errors are not that frequent .. but they are still there :( .. its still being modified by some other threads ...


Could you please let us know how do u intend to implement ur proposed solution

regards

Imran

Christoph Gaffga (triplemind.com) wrote:
sorry, was to quick :((

> So I decided to patch the DefaultIncludeCacheManager to work in the same > way as the IncludeTransformer does, by setting up the child threads with
> the same context/environment:
>
>   // Setup this thread's environment
>   RequestContextHolder.setRequestAttributes(
>                             this.session.getRequestAttributes());
>   EnvironmentHelper.enterProcessor(this.session.getProcessor(),
>                             this.session.getEnvironment());
>
> I'll test this out, and if it work's I send in the patch.

it does not help. It's the way it's meant to work, but it doesn't.
Somehow the ObjectModels in the parallel running JXTemplateGenerators affect each other and we have strange side affects on most of our request.

we are digging around, but no ideas any more how to fix it...

any help would be appreciated.

Christoph

Reply via email to