Setup Hibernate Session Factory in Tomcat
Posted
by
Mark Estrada
on Stack Overflow
See other posts from Stack Overflow
or by Mark Estrada
Published on 2011-01-03T03:39:52Z
Indexed on
2011/01/03
3:53 UTC
Read the original article
Hit count: 252
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.
© Stack Overflow or respective owner