-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: SOS!! Simple yes/no question about JPA...
PostPosted: Tue Apr 10, 2007 3:00 pm 
Newbie

Joined: Thu Apr 05, 2007 5:57 am
Posts: 10
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 12, 2007 5:30 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
solution 1, take time to read Java Persistence with Hibernate (see top banner), that will help you understand the architecture choices

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.