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: Understanding Cache implementation in Nhibernate
PostPosted: Mon Jul 17, 2006 2:00 am 
Beginner
Beginner

Joined: Fri Jul 07, 2006 12:08 pm
Posts: 37
This is my understaning..

by default Nhibernate implements caching,eg i ask nhibernate to return me a collection of customers during an Isession.Then,when next time i need this collection,say from a different page,nhibernate gets from cache,not database..tite?

When Isession gets destroyed? After each request from a user,or when i say Isession.close,or when users session gets over,say when he closes the browser..

And,how is second level of caching different?

thks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 17, 2006 3:42 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
First level cache lives with the ISession. When you close ISession it goes away. Second level cache can live longer.

ISession is destroyed with GC as any other object. But it is required to .Close it as fast as possible to free unmanaged resources (eg. Database Connection).

I recommend "Hibernate in action" book - it will answer all such a questions and allow to avoid many traps with NH, take a look if possible.

_________________
michal


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.