title: Setup Hibernate Session Factory in Tomcat
body: <p>I have been reading around the Hibernate core and I am still exploring some of its capability.</p>
  
  <p>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.</p>
  
  <p>Does anybody knows how to properly setup the session factory in tomcat web applications?  Any links or tutorials would be better.</p>
  
  <p>Should I set it up as a contextlistener class also?</p>
  
  <p>Thanks.</p>