-->
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: Data initialization
PostPosted: Mon Jul 26, 2004 1:56 pm 
Newbie

Joined: Wed Apr 07, 2004 1:32 pm
Posts: 18
Hi,

I have some metadata stored in tables, and this data is constantly accessed, sometimes by graph navigation, other times by HQL.

I want to load all the data and build the relationship graph. I would like everything cached so hibernate doesn't have to go to the database for these classes.

I'm talking about 5 classes, with relationships to each other.

What I did was to Hibernate.initialize() every instance and collection,
but this process is very slow, around 15 seconds.

It there a better way?

Thanks,
Felipe;


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 26, 2004 4:15 pm 
Beginner
Beginner

Joined: Thu Jun 24, 2004 1:04 pm
Posts: 35
Location: Minnesota - USA
You're gonna have to take the SQL hits at least once. However, if you have a 2nd level cache working you can take them only once:
http://www.hibernate.org/hib_docs/refer ... ance-cache

You'll likely want to setup a query cache as well, so the relations are also cached:
http://www.hibernate.org/hib_docs/refer ... querycache

You're going to have to chose a 2nd level cache provider that is appropriate for your application. Also keep in mind a 2nd level cache is not appropriate if the data in the database is going to be changed by another application.

--gus


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.