cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <>
Subject Re: [Flow] Serious problem with cocoon.getComponent(id)
Date Wed, 02 Jul 2003 16:14:01 GMT
Sorry, but the fix suggested in that thread is not correct. The problem 
is that the "cocoon" object with the null component manager is an 
invalidated reference to another user's instance. This is clearly a bug 
in the flow implementation. By storing the componentManager itself in a 
global variable you are merely working around the bug.

When looking up global variables normally Rhino looks in the "lexical" 
scope of a function (i.e. it uses the global variables present when the 
function was compiled). Rhino has an option however to compile with 
"dynamic" scopes. This means that global variables are looked up in the 
context of the function's caller instead of the lexical scope. This is 
what we use in Cocoon, in order to support multiple users. Each user 
thread has its own dynamic scope (and its own instance of the "cocoon" 
object). In between calls to your script the "cocoon" object is 
invalidated (among other things its component manager is set to null).

I recently fixed a problem where the dynamic scope was not being set up 
properly when a script was executed. Can you please verify that 
rhino1.5r4-continuations-20030605.jar is in your classpath and 
rhino1.5r4-continuations-20030323.jar is not.

Of course, it's possible that there is an additional problem here that 
needs to be debugged.



Frank Taffelt wrote:

>>I can't reproduce this. Are you sure you don't have an old version of
>>in your classpath? I fixed a problem with setting up dynamic scopes
>were your changes before 2.1M2 ? I had the same problems, see
> for
>After applying the suggested change, the problems never occured again. For
>me, the new  Database.js doesn't really change something, but nevertheless -
>the null componentmanager problem never raised again.
>Maybe the suggested change in database.js gives you a idea where to look for

View raw message