-->
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.  [ 3 posts ] 
Author Message
 Post subject: Cache
PostPosted: Fri Apr 28, 2006 11:55 am 
Beginner
Beginner

Joined: Mon Feb 13, 2006 8:34 pm
Posts: 27
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

This part is from hibernate_reference (chapter 13:batch processing):

..."That's because Hibernate
caches all the newly inserted Customer instances in the session-level cache"...

Hibernate is very efficient when we make some comparison to other ORMs, is this because of such a big cache? Isn't this too big waste of memory:-).


Top
 Profile  
 
 Post subject: cache use
PostPosted: Mon May 01, 2006 8:43 am 
Newbie

Joined: Wed Apr 26, 2006 6:29 am
Posts: 4
Location: India
Yes, Memorey will be wasted but there is a use ie.,
Hibernate avoids the overhead of retrieving objects from the
database each time.

------------------------------------
dont forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 01, 2006 9:58 am 
Regular
Regular

Joined: Wed Jul 27, 2005 2:33 am
Posts: 118
Quote:
Isn't this too big waste of memory:-).


Certainly not. If you do not use second level cache, then queries are fired to database to retrieve the objects. Database operations are considered to be slow, resource consuming and expensive. If you enable second level cache, then the objects can be resolved in the memory and the operation is much faster.

Also, you do have ways of specifying which object to cache, how long to cache(the eviction policy). So you do have control of how and how many objects stay in memory(cache)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.