cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Pötz <reinhard_po...@gmx.net>
Subject RE: Flow Database stuff ( The new FOM? )
Date Tue, 15 Jul 2003 06:50:17 GMT

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

> Reinhard Pötz wrote:
> 
> >From: Jeremy Quinn
> >
> >  
> >
> >>What I do not grok ATM, how does the Hibernate Session automatically
> >>get closed at the appropriate time (ie. after the view layer has 
> >>completed)?
> >>    
> >>
> >
> >IIU the current flow implementation correctly you have no 
> chance but to 
> >use lazy initializiation as implemented by you because after reaching
> >sendPageAndWait() the flow interpreter has no chance to 
> react. Maybe we 
> >need something like a "finalize" in pipeline processing where those 
> >things (releasing of components) are done.
> >
> >HTH
> >Reinhard
> >
> >
> >  
> >
> Actually, although not particularly user-friendly, there is a 
> way to do 
> this, even now, with the extended "catch" syntax supported by Rhino 
> (which is intended to provide functionality similar to 
> "dynamic-wind" in 
> Scheme):
> 
> 
> var hibSession = null;
> 
> function getSession() {
>     if (hibSession == null) {
>         hibSession = cocoon.getComponent("hibernateSession");
>     }
> }
> 
> function releaseSession() {
>      if (hibSession != null) {
>           cocoon.releaseComponent(hibSession);
>           hibSession = null;
>      }
> }
> 
> 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

> 
> catch (continue) {
>          // a continuation is being restored
>          // code to handle that goes here
> }
> 
> function myFlow() {
>      var custBean = getSession().blah;
>      sendPageAndWait("cust.xml", custBean);
>      var anotherBean = getSession().blahblah
> }
> 


Mime
View raw message