Re: Hibernate + Tomcat - where to bind the session to?
- From: rusty@xxxxxxxxxxxxxxxxxx
- Date: 25 Apr 2005 17:13:29 -0700
Get the book Hibernate in Action, by Christian Bauer and Gavin King.
It's well worth it. It covers this question, and everything else.
voigt@xxxxxxxx writes:
> Hello group,
>
> I am building a web application with Tomcat and Hibernate as O/R
> mapper. Now my question is where should I bind the session to?
>
> At the moment I have the Hibernate Session as a ThreadLocal, so for
> each thread a new HibernateSession is created. Another possibility
> would be to bind the hibernateSession to the httpSession, so each user
> has his/her own Hibernate session. Does this make sense? How much mem
> would this take up per user? Perhaps it makes it easy to DOS the
> server?
>
> Another thing which is related to the above thoughts: is it OK to
> store a persistent object in the HTTPSession temporarily for some
> time? What if hibernateSession from thread A fetches the object,
> thread B changes it and thread C calls saveOrUpdate() ? Will this
> break my app or will it work?
>
> I am a bit confused about this and looking forward to your answers :)
>
> Greetings
> Bastian Vogit
.
- Prev by Date: Question on resultSet's
- Next by Date: Re: [hibernate][oracle 10g]enregistrer blob
- Previous by thread: Question on resultSet's
- Next by thread: Hibernate and Paradox
- Index(es):
Relevant Pages
|
|