Hibernate + Tomcat - where to bind the session to?
voigt_at_ynnor.de
Date: 02/10/05
- Previous message: kaeli: "Re: simple sql query, but don't get it ..."
- Next in thread: Dieter Bender: "Re: Hibernate + Tomcat - where to bind the session to?"
- Reply: Dieter Bender: "Re: Hibernate + Tomcat - where to bind the session to?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 10 Feb 2005 10:52:32 -0800
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
- Previous message: kaeli: "Re: simple sql query, but don't get it ..."
- Next in thread: Dieter Bender: "Re: Hibernate + Tomcat - where to bind the session to?"
- Reply: Dieter Bender: "Re: Hibernate + Tomcat - where to bind the session to?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|