On Thursday 07 October 2004 01:42, Adam Walsh wrote:
> Emond Papegaaij wrote:
> >When running our cocoon application on some systems, we run into a very
> >strange and hard to find problem. Our application uses cForms and a custom
> >flow engine to display these forms. In some cases, when the user submits
> > the form, the flow engine receives an empty request object. With empty I
> > mean non of the request parameters are present. 
>
> I've noticed the same problem Emond describes with empty request objects 
> while using CForms and Flow in Cocoon 2.1.5. Does anyone have any
> thoughts on what could be causing this?

I've done some thorough debugging on both the Cocoon and Tomcat source. It 
seems as Cocoon does not support multiple threads, even when these threads 
are properly synced. So if you're starting a threads from within the flow, 
I'd suggest to find another way to tackle your problem. This is one of the 
things I've tried:
- Get some info from the current context and print it
- Start a thread
- Lock the first thread
- Get the same info from the context and print it

The info can be about anything, but the Request object will do. It turned out 
that the results were not the same. Somehow the Request object is different 
inside the second thread. Returning to the first thread gave the old Request 
object again.

In our application the second thread is the flow. This flow is locked and 
resumed on each sendPageAndWait. I've managed to work around this problem by 
sending Expression objects from the flow to the main servlet thread. The main 
servlet thread executes these Expressions and returns the result. I've added 
this wrapper around all the communication points between the flow and Cocoon. 
This made the problem dissappear. Of course this is not a very clean 
solution, so we are thinking about implementing our own Java VM to run the 
flow.

Emond Papegaaij

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to