RE: Hibernate Session to User Session

2004-06-08 Thread Marco Mistroni
n I checked The Struts plugin for hibernate and hibernate samples.. Sorry for not being of any much help :-( Regards marco -Original Message- From: Riyad Kalla [mailto:[EMAIL PROTECTED] Sent: 08 June 2004 14:54 To: Struts Users Mailing List Subject: Re: Hibernate Session to U

Re: Hibernate Session to User Session

2004-06-08 Thread Riyad Kalla
Marco, I believe that is what I am using now (it seems to be quite popular) but I don't quite understand the reasoning behind the ThreadLocal approach (I've actually never used 'ThreadLocal')... can you shed some light on this? What the mapping between Hibernate Sessions and Users (or Threads)

RE: Hibernate Session to User Session

2004-06-08 Thread Marco Mistroni
Hi, On hibernate website, there's an example that associates A session to a threadlocal. You can safely use that pattern (it's one Of hibernate patterns)... You could have a DAOFactory (plugin) which instantiates the SessionFactory, And each DAO will get its own session associated with its

RE: Hibernate Session to User Session

2004-06-07 Thread David Friedman
It's not very process intensive if you are using a connection pool where it just hands you an already-open connection. Hibernate can use a few different connection pools including JCS, C3P0, OSCache, etc. Regards, David -Original Message- From: Riyad Kalla [mailto:[EMAIL PROTECTED] Se

Re: Hibernate Session to User Session

2004-06-07 Thread Riyad Kalla
Brian, I agree that sounds very expensive, I don't know how Hibernate works yet so I didn't know what a Hibernate Session really consists of to know if that was as resource intensive as it sounded. If this is the case, then I suppose using the HibernateUtil that I am using now from the Hibernat

Re: Hibernate Session to User Session

2004-06-07 Thread Brian Alexander Lee
Wouldn't that be pretty resource intensive since it would basically mean that you have a database connection for every user session in your app. Typically that is pretty bad and getting a new connection from a connection pool is usually pretty quick. I'm unfamiliar with how hibernate manges sessio