beehive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Diephouse <>
Subject Re: Lifecycle Questions
Date Mon, 29 Nov 2004 22:13:02 GMT
Kyle Marvin wrote:

>The resource scope of a controller is similar to the scope of the JSP
>page.  It enables control resources to be held for the duration of the
>processing of an action, not for the lifetime of an entire flow (which
>may span multiple requests).  State another, resource acquisition
>*never* spans across multiple (http) requests for either jsp pages or
>pageflows, so should be appropriate (I think) for Hibernate sessions
>in either context.
Thanks, that part makes a lot more sense now.  However, I have been 
playing with nested controls.  In this example I have a control called 
BlogTool which is used in my controller.  I have also have the 
HibernateControl which is used in my BlogTool.  The BlogTool control 
provides a pretty wrapper for hibernate queries, etc.

public class BlogToolImpl
    implements BlogTool
    @Control HibernateControl control;
    @Context ResourceContext resourceContext;

My BlogTool is receives onAcquire/onRelease events for every http 
request.  But, the HibernateControl doesn't receive these events for 
ever http request.  The HibernateControl's resource lifecycle seems to 
be the duration of the Controller (ie, an HttpSession).  Whats the 
reasoning for that?  I would think that the child control would have the 
same lifecycle as its parent. Is there anyway to get the events that the 
parent receives as well?

- Dan

Dan Diephouse
Envoi Solutions LLC

View raw message