Also, if I inject a Hibernate Session, and a HttpServletRequest, how does threading work with that?
I mean, one thread could be running through the singleton, processing one request against the session, right as another one enters. How do you inject 2 per-thread managed hibernate sessions into a singleton? I guess I can't wrap my head around injecting services into singleton services, and yet having that singleton remain safe, especially when the injected services are potentially per-thread. Also, when working with a page using hibernate and injecting a session. Say I have a event handler that deletes a subobject ( onActionFromDelete ), and of course I annotate it with commitAfter because I want that change saved. So when is a new session created and injected? When OnActivate is called again to re-render the page? I guess I don't understand the threading and magic in services ( so I know how to write my service ). On Thu, Apr 9, 2009 at 10:21 PM, daniel joyce <daniel.a.jo...@gmail.com> wrote: > public MyRequestFilter implements RequestFilter { > > private final HttpServletRequest servletRequest; > > public MyRequestFilter(HttpServletRequest request) { > servletRequest = request; > } > > public boolean service(Request request, Response response, > RequestHandler handler) > { > //do stuff with the servlet request. > return handler.service(request,response); > } > } > > If RequestFilter is a singleton, wouldn't this simply not work? Since > HttpServletRequest is essentially per-thread? And we are only set it > once when the filter is built? But if scoped as per-thread, would it > work then? > > -Daniel > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org