You might also configure the filter such that it is not active for paths where you are sure you don't need the filter (think "Web-Content/StaticImages/*.jpg" or other static content)
Thomas On Thu, Feb 5, 2009 at 3:56 AM, Igor Vaynberg <[email protected]>wrote: > a single request is processed by a single thread. what might happen > is, if you hit a page that has images, the browser will open more > requests to retrieve those images - which will create more threads. > > what you should do is handle the session creation lazily - only create > it when it is requested. use the filter to close the session (if its > there) and reset a threadlocal holder rather then create the session > in the filter. > > see brix-cms.googlecode.com - there is code in there that does just that. > > -igor > > On Wed, Feb 4, 2009 at 2:19 PM, Edgar Merino <[email protected]> wrote: > > Hello, > > > > I'm implementing a j2ee filter to obtain a jcr session per http request > > (using a threadlocal), however it sometimes opens more than once session > > when I open a webpage, I'm thinking this is because many threads are > > involved in a single request, but this affects performance (a lot), what > > workaround can I apply to avoid this kind of overhead (to have a real > > session per request instead of session per thread?). > > > > Correct me if I made the wrong assumptions, > > Edgar Merino > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Thomas Mäder www.devotek-it.ch
