Database connection via Hibernate in servlets

Posted by blackliteon on Stack Overflow See other posts from Stack Overflow or by blackliteon
Published on 2010-03-12T11:48:14Z Indexed on 2010/03/12 11:57 UTC
Read the original article Hit count: 258

Filed under:
|
|

What is the best place in servlet for Hibernate code that returns HibernateSessionFactory ?

I saw many examples: ones put db connection in service methods. Others - use smth like HibernateUtil (Singleton) that returns HibernateSessionFactory.

I don't know is it safe to use HibernateUtil in multithreaded Servlets ?

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate