Hello,
I have the following environment and requirements:
-Tomcat 5.5 (no ejb container)
-Latest version of Hibernate
-JSF 1.1
-A requirement to use JPA
-I must use the query cache and the second-level cache
My question is as follows:
What is the best solution?
Solution 1.
ONE EntityManagerFactory stored in the ServletContext for use by all of my web app users generating MULTIPLE INSTANCES of EntityManagers. (would this allow me to use the query cache?)
Solution 2.
ONE EntityManagerFactory and ONE EntityManager stored in the ServletContext for use by all of my web app users.
Thanks in advance,
Julien.
|