You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vinicius Carvalho <ja...@gmail.com> on 2006/08/22 19:53:18 UTC

OpenSessionInViewFilter configuration

Hello there! I'm using OSIVF with spring in my app. I had it
configured just like examples on the wiki:

 <filter-mapping>
	<filter-name>hibernateFilter</filter-name>
<url-pattern>/app</url-pattern>

But I have a few pages that I want to turn it off, is it possible? I
tried before using pattern=*.html and put those pages in a different
path, but I get some errors using *.html.

Best Regards

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


Re: OpenSessionInViewFilter configuration

Posted by Vinicius Carvalho <ja...@gmail.com>.
BTW Henri, I'm using (I guess yours) implementation of OSIVF
(HibernateRequestFilter), so far its working great (I've dump the
Spring version, cuz when I add friendly urls for direct service. It
quit working, I guess I needed another filter mapping on web.xml)

Just wanna now, if spring transaction management will work smoothly
with this approach (I mean, just like it is with
opensessioninviewfilter)

Regards

On 8/23/06, Henri Dupre <he...@gmail.com> wrote:
> I wouldn't have any concerns about performances. An empty hibernate session
> is lightweight. We did originally consider not opening hibernate sessions
> for some pages but the impact on performances was so low that we did not
> bother doing anything like that. What does matter on the performance side
> however is to close the sessions or at least flush them. If you follow the
> spring opensessioninview filter code, it will handle that for you.
>
> Ideally it would be nice to have an annotation in the page class to say that
> you need a hibernate session or not... but the framework can't handle it
> completly transparently because some apps implement long sessions that span
> over several requests... it is up the the app to define the session
> strategy.
>
> Also creating sessions on demand wouldn't too difficult either to implement,
> but hibernate is smart enough with the sessions so that it doesn't require
> much resources to create one. All db connections and everything else would
> be handled on the first db access. What does have more an impact on
> performance is the hibernate cache. Definitly worth to spend time fine
> tuning it, on our website, most requests don't even require any db access.
>
>
>
>
>
> On 8/22/06, hv @ Fashion Content <in...@fashioncontent.com> wrote:
> >
> > I have the same concerns, but for some reason few people care to make the
> > creation and closing of a session depend on actual use.
> > Relating it to the page name is a weak solution imo. It should be a
> > concern
> > handled strictly and transparently by the persistence framework
> > (provided that you define the servlet filter of course).
> >
> > Henrik
> >
> > "Vinicius Carvalho" <ja...@gmail.com> skrev i en meddelelse
> > news:fde284ef0608221304m1c344806jb3515e294fedc732@mail.gmail.com...
> > > Well I guess, I'm just worried about performance, those page will
> > > handle a few thousands of concurrent users, and they use ajax, we
> > > expect something like 500-700 simultaneous requests for the pages.
> > >
> > > Best regards
> > >
> > > On 8/22/06, Henri Dupre <he...@gmail.com> wrote:
> > >> Do you really need to turn it off?
> > >> It shouldn't hurt to have it on even if you don't need an hibernate
> > >> session.
> > >>
> > >>
> > >>
> > >> On 8/22/06, Vinicius Carvalho <ja...@gmail.com> wrote:
> > >> >
> > >> > Hello there! I'm using OSIVF with spring in my app. I had it
> > >> > configured just like examples on the wiki:
> > >> >
> > >> > <filter-mapping>
> > >> >        <filter-name>hibernateFilter</filter-name>
> > >> > <url-pattern>/app</url-pattern>
> > >> >
> > >> > But I have a few pages that I want to turn it off, is it possible? I
> > >> > tried before using pattern=*.html and put those pages in a different
> > >> > path, but I get some errors using *.html.
> > >> >
> > >> > Best Regards
> > >> >
> > >> > ---------------------------------------------------------------------
> > >> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > >> > For additional commands, e-mail: users-help@tapestry.apache.org
> > >> >
> > >> >
> > >>
> > >>
> > >> --
> > >> Henri Dupre
> > >> Actualis Center
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: users-help@tapestry.apache.org
> > >
> > >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Henri Dupre
> Actualis Center
>
>

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


Re: OpenSessionInViewFilter configuration

Posted by Henri Dupre <he...@gmail.com>.
I wouldn't have any concerns about performances. An empty hibernate session
is lightweight. We did originally consider not opening hibernate sessions
for some pages but the impact on performances was so low that we did not
bother doing anything like that. What does matter on the performance side
however is to close the sessions or at least flush them. If you follow the
spring opensessioninview filter code, it will handle that for you.

Ideally it would be nice to have an annotation in the page class to say that
you need a hibernate session or not... but the framework can't handle it
completly transparently because some apps implement long sessions that span
over several requests... it is up the the app to define the session
strategy.

Also creating sessions on demand wouldn't too difficult either to implement,
but hibernate is smart enough with the sessions so that it doesn't require
much resources to create one. All db connections and everything else would
be handled on the first db access. What does have more an impact on
performance is the hibernate cache. Definitly worth to spend time fine
tuning it, on our website, most requests don't even require any db access.





On 8/22/06, hv @ Fashion Content <in...@fashioncontent.com> wrote:
>
> I have the same concerns, but for some reason few people care to make the
> creation and closing of a session depend on actual use.
> Relating it to the page name is a weak solution imo. It should be a
> concern
> handled strictly and transparently by the persistence framework
> (provided that you define the servlet filter of course).
>
> Henrik
>
> "Vinicius Carvalho" <ja...@gmail.com> skrev i en meddelelse
> news:fde284ef0608221304m1c344806jb3515e294fedc732@mail.gmail.com...
> > Well I guess, I'm just worried about performance, those page will
> > handle a few thousands of concurrent users, and they use ajax, we
> > expect something like 500-700 simultaneous requests for the pages.
> >
> > Best regards
> >
> > On 8/22/06, Henri Dupre <he...@gmail.com> wrote:
> >> Do you really need to turn it off?
> >> It shouldn't hurt to have it on even if you don't need an hibernate
> >> session.
> >>
> >>
> >>
> >> On 8/22/06, Vinicius Carvalho <ja...@gmail.com> wrote:
> >> >
> >> > Hello there! I'm using OSIVF with spring in my app. I had it
> >> > configured just like examples on the wiki:
> >> >
> >> > <filter-mapping>
> >> >        <filter-name>hibernateFilter</filter-name>
> >> > <url-pattern>/app</url-pattern>
> >> >
> >> > But I have a few pages that I want to turn it off, is it possible? I
> >> > tried before using pattern=*.html and put those pages in a different
> >> > path, but I get some errors using *.html.
> >> >
> >> > Best Regards
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> >> > For additional commands, e-mail: users-help@tapestry.apache.org
> >> >
> >> >
> >>
> >>
> >> --
> >> Henri Dupre
> >> Actualis Center
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Henri Dupre
Actualis Center

Re: OpenSessionInViewFilter configuration

Posted by "hv @ Fashion Content" <in...@fashioncontent.com>.
I have the same concerns, but for some reason few people care to make the 
creation and closing of a session depend on actual use.
Relating it to the page name is a weak solution imo. It should be a concern 
handled strictly and transparently by the persistence framework
(provided that you define the servlet filter of course).

Henrik

"Vinicius Carvalho" <ja...@gmail.com> skrev i en meddelelse 
news:fde284ef0608221304m1c344806jb3515e294fedc732@mail.gmail.com...
> Well I guess, I'm just worried about performance, those page will
> handle a few thousands of concurrent users, and they use ajax, we
> expect something like 500-700 simultaneous requests for the pages.
>
> Best regards
>
> On 8/22/06, Henri Dupre <he...@gmail.com> wrote:
>> Do you really need to turn it off?
>> It shouldn't hurt to have it on even if you don't need an hibernate 
>> session.
>>
>>
>>
>> On 8/22/06, Vinicius Carvalho <ja...@gmail.com> wrote:
>> >
>> > Hello there! I'm using OSIVF with spring in my app. I had it
>> > configured just like examples on the wiki:
>> >
>> > <filter-mapping>
>> >        <filter-name>hibernateFilter</filter-name>
>> > <url-pattern>/app</url-pattern>
>> >
>> > But I have a few pages that I want to turn it off, is it possible? I
>> > tried before using pattern=*.html and put those pages in a different
>> > path, but I get some errors using *.html.
>> >
>> > Best Regards
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>>
>>
>> --
>> Henri Dupre
>> Actualis Center
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
> 




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


Re: OpenSessionInViewFilter configuration

Posted by Vinicius Carvalho <ja...@gmail.com>.
Well I guess, I'm just worried about performance, those page will
handle a few thousands of concurrent users, and they use ajax, we
expect something like 500-700 simultaneous requests for the pages.

Best regards

On 8/22/06, Henri Dupre <he...@gmail.com> wrote:
> Do you really need to turn it off?
> It shouldn't hurt to have it on even if you don't need an hibernate session.
>
>
>
> On 8/22/06, Vinicius Carvalho <ja...@gmail.com> wrote:
> >
> > Hello there! I'm using OSIVF with spring in my app. I had it
> > configured just like examples on the wiki:
> >
> > <filter-mapping>
> >        <filter-name>hibernateFilter</filter-name>
> > <url-pattern>/app</url-pattern>
> >
> > But I have a few pages that I want to turn it off, is it possible? I
> > tried before using pattern=*.html and put those pages in a different
> > path, but I get some errors using *.html.
> >
> > Best Regards
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
>
>
> --
> Henri Dupre
> Actualis Center
>
>

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


Re: OpenSessionInViewFilter configuration

Posted by Henri Dupre <he...@gmail.com>.
Do you really need to turn it off?
It shouldn't hurt to have it on even if you don't need an hibernate session.



On 8/22/06, Vinicius Carvalho <ja...@gmail.com> wrote:
>
> Hello there! I'm using OSIVF with spring in my app. I had it
> configured just like examples on the wiki:
>
> <filter-mapping>
>        <filter-name>hibernateFilter</filter-name>
> <url-pattern>/app</url-pattern>
>
> But I have a few pages that I want to turn it off, is it possible? I
> tried before using pattern=*.html and put those pages in a different
> path, but I get some errors using *.html.
>
> Best Regards
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Henri Dupre
Actualis Center