do you need a transaction around the resource when only the lastModifiedTimeStamp is ask for? is your resource really cachable?
johan On Fri, Mar 7, 2008 at 2:15 PM, Kaspar Fischer <[EMAIL PROTECTED]> wrote: > I have a general question on how to wrap transaction boundaries around > requests > to a WebResource. As discussed in the thread > > http://markmail.org/message/tbpg65xd5x26v7xf > > there are two possible requests: an ordinary web request (with a > RequestCycle) > and a HEAD request (where no RequestCycle exists). If an application > needs to > wrap transaction boundaries around such requests, how should it do this? > > The former kind of request can wrapped by listening to WebRequestCycle's > onBeginRequest and onEndRequest methods, but the latter needs *another* > way, it seems. Is there a way that handles both cases? > > Thanks a lot for any hint! > Kaspar > > On 07.03.2008, at 13:06, Kaspar Fischer wrote: > > > On 07.03.2008, at 13:01, lars vonk wrote: > > > >> I guess you can't. Since you are in the Application init method I > >> don't think there is a requestcycle available (request cycles > >> represents the processing of a request). > > > > I am not trying to get the request cycle inside my application's > > init(), > > but in getResourceStream(). > > > > Still, I think your explanation applies again: getResourceStream() > > is apparently called (why?) even when the web server is doing a > > HEAD request, in which case there is (?) no request cycle either. > > Could this be the case? > > > >> On Fri, Mar 7, 2008 at 12:19 PM, Kaspar Fischer > >> <[EMAIL PROTECTED]> wrote: > >>> How can I get hold of the current request cycle in a subclass of > >>> WebResource? > >>> In > >>> > >>> public final class RepositoryFileResource extends WebResource > >>> { > >>> /* ... */ > >>> > >>> public IResourceStream getResourceStream() > >>> { > >>> RequestCycle cycle = RequestCycle.get(); > >>> > >>> cycle is null. > >>> > >>> P.S. I am registering my resource in my application's init() > >>> > >>> getSharedResources().add("repo", new RepositoryFileResource()); > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >