cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Oliver <res1c...@verizon.net>
Subject Re: Flow Database stuff ( The new FOM? )
Date Tue, 15 Jul 2003 07:28:22 GMT
Reinhard Pötz wrote:

>From: Christopher Oliver [mailto:res1cf5x@verizon.net] 
>  
>
<snip>

>  
>
>>catch (break) {
>>          // a continuation is being captured,  
>>          // code to handle that goes here
>>         releaseSession();
>>}
>>    
>>
>
>... and this is called after the pipeline has been processed? How is
>this possible from a technical POV? If the view layer is called by
>sendPageAndWait the flow interpreter isn't active until the response
>returns from the client (map:call continuation="...").
>
>Reinhard
>  
>
Unfortunately, you're right. In this case the call to releaseSession() 
is made when the continuation is created - which is before the view 
layer is called (see fom_system.js).

I've just commited an update to Rhino that [re-]enables a further syntax 
extension, namely:

catch (return) {
     // This continuation is about to be replaced with another continuation
     // code to handle that goes here
}

By placing the code to release the hibernate session inside, i.e.

catch (return) {
     cocoon.releaseComponent(hibSession);
}

you get the effect you're looking for: namely that the session is 
released after calling the view layer but before control leaves the 
interpreter.

As I said, Ovidiu and I decided to put these features in to try to 
provide the functionality provided by dynamic-wind in Scheme, but this 
kind of explicit resource management seems awkard and error-prone.


Chris


Mime
View raw message