-->
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: Cache + JUnit
PostPosted: Tue Apr 13, 2004 4:47 pm 
Beginner
Beginner

Joined: Mon Mar 08, 2004 5:22 pm
Posts: 35
I have my Session open in junit setUp(), and close in tearDown() methods.
My DAO layer takes the session as parameter and queries the db.
query is set to cacheable. What if i handle the session issue in web app using servlet filter or something. How does cache is going to behave after the session is closed in multi user environment. For example 1st user makes a request and loads the data into cache. servlet filter is going to close the session as soon as the response is returned. Now can the 2nd user use the cached result by the first user ? even after session is closed ?

Or should i leave the session open for the life of the application ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 14, 2004 7:35 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Hibernate has a two level cache architecture. The session is first level local cache and should not be left open. The optional second level cache (default is ehcache) provides global caching. Read the wiki for information on the caching options. http://www.hibernate.org/hib_docs/reference/html/performance.html#performance-s3


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.