I have a series of applications which all use Hibernate and, at the moment, exist in the same Tomcat 5.5 container. As each app is in a different context Hibernate is deployed and loaded by the container for each app. The disadvantage of this is that the 2nd level cache must be disabled or at least minimized to ensure consistency across the contexts.
Is it possible to make a single hibernate instance available at the container level within Tomcat and access session factory across multiple contexts? If so, are there any examples out there (two days of searching and nothing!!!)
A better question might be: is there a better method for sahring a Hibernate instance given the Tomcat constraint?
|