摘要: 原文地址:http://www.hibernate.org/300.html
在Tomcat5.5.x環境下,調用Configuration().addCacheableFile來載入配置,建立Hibernate SessionFactory,成功地提高了載入速度。
推薦你只是在開發階段采用這樣的方式載入,最后的產品發布階段你仍需使用經典的Hibernate.cfg.xml文件,通過Tomcat的ServletContextListener API在應用程序部署的時候建立Hibernate SessionFactory,而不是在程序第一次調用Hiberante的時候。
閱讀全文