From: Jeremy Quinn [mailto:[EMAIL PROTECTED]
> > On Tuesday, July 15, 2003, at 08:28 AM, Christopher Oliver wrote: > > > Reinhard Pötz wrote: > > > >> From: Christopher Oliver [mailto:[EMAIL PROTECTED] > > <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. > > Thanks Chris > > I think I will stick with the TomCat Filter technique at the IIRC filters are part of the servlet spec, aren't they? > moment, I > am struggling to see the advantage of using > cocoon.***Component() stuff > in this situation to be honest. In this case it's a matter of taste. But I will do some research with the alternative implementation by Chris. Cheers, Reinhard