cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Ziegeler <cziege...@apache.org>
Subject Re: C2.2 and OpenSessionInViewInterceptor
Date Mon, 10 Dec 2007 12:10:43 GMT
Robin Wyles wrote:
> Hi,
> 
> I would like to implement something similar to Spring's
> OpenSessionInViewInterceptor [1] in Cocoon 2.2 - the idea being to open
> a Hibernate session when specific pipelines are called, binding it to
> the current thread and then closing it when the pipeline execution (and
> therefore the view) has finished. I know I could use the
> OpenSessionInViewFilter [2], but the URL mapping is unwieldy and is not
> fine grained enough for my needs, and I'm not even sure if the filter
> would be called when pipelines are called by other blocks (anyone know?).
> 
> My first idea was to extend one of the existing pipeline implementations
> but it seems this won't work for pipelines that include calls to
> flowscript functions as these are handled before the pipeline is set up.
> Ideally I would like to enable this functionality for specific
> pipelines, so if anyone has any ideas about how I could go about
> implementing this I'd love to hear it!
> 
I can't give the details, but we added sitemap listeners for things like
these. Basically, you can register a listener for a specific sitemap and
this is notified when the whole request has been processed by Cocoon -
so you can clean up afterwards.

Carsten

> Thanks,
> 
> Robin
> 
> 
> [1]
> http://static.springframework.org/spring/docs/2.0.6/api/org/springframework/orm/hibernate3/support/OpenSessionInViewInterceptor.html
> 
> [2]
> http://static.springframework.org/spring/docs/2.0.6/api/org/springframework/orm/hibernate3/support/OpenSessionInViewFilter.html


-- 
Carsten Ziegeler
cziegeler@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message