Setup Hibernate Session Factory in Tomcat
- by Mark Estrada
Hi All,
I have been reading around the Hibernate core and I am still exploring some of its capability.
It was mention in the docs that the SessionFactory is the heavyweight component of Hibernate thus it should be setup only once in a web application and in singleton. Each Session factory should pertain to one JDBC connection.
Does anybody knows how to properly setup the session factory in tomcat web applications? Any links or tutorials would be better.
Should I set it up as a contextlistener class also?
Thanks.