-->
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.  [ 5 posts ] 
Author Message
 Post subject: Data Caching using Hibernate
PostPosted: Mon Oct 13, 2003 9:27 am 
Newbie

Joined: Thu Sep 25, 2003 11:09 am
Posts: 6
Location: Auburn Hills, MI, USA
Hello,

In an application, some related data in around a score of tables are mostly static, and remain so for almost (for this discussion, lets skip the word almost) the life of the application.
I am planning to load this tabular data as objects at application initialization (or, on demand). These objects act as the cache for the data in these tables to the rest of the application objects.

    How good is the idea of using Hibernate to load these objects from an RDBMS?
    Is it overkill?
    Is this not what Hibernate is built and meant to do?
    Would I be better off writing a custom built cache loader?


I would appreciate all your views on this.

Thanks,
Balaji


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 5:12 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Are your data used in other queries (not only in init time) ?
If yes, you can use Hibernate and JVM level caching system. Those objects won't be loaded several times.

Does your data implements complex relationship between them ?
It's easier to map it once and let Hibernate deals with loading

Do you use Hiberate in other part of your app ?

Do you (or one of your team) have experience with Hibernate ?

Do you want to give it a try ?

If you answered yes to one of those questions, let's roll.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 8:19 am 
Newbie

Joined: Thu Sep 25, 2003 11:09 am
Posts: 6
Location: Auburn Hills, MI, USA
epbernard wrote:
Are your data used in other queries (not only in init time) ?
If yes, you can use Hibernate and JVM level caching system. Those objects won't be loaded several times.

Yes, they will be used elsewhere too. I've made a note to get to know more about JVM caching in Hibernate.

Quote:
Does your data implements complex relationship between them ?
It's easier to map it once and let Hibernate deals with loading

Nothing too complex.. .

Quote:
Do you use Hiberate in other part of your app ?

No..

Quote:
Do you (or one of your team) have experience with Hibernate ?

No..

Quote:
Do you want to give it a try ?

Yes.. sure.

Quote:
If you answered yes to one of those questions, let's roll.


Thank you for your comments.. does your opinion change based on the two "No"s above?

-Balaji


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 10:18 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I'm not very objective, this is an Hibernate forum ;-)
My 1st question meant, do you think your cached object will be involved in other JDBC requests. If so, implments your requests with Hibernate, and you will benefit from your previous mapping.

This is a good start to make your home maid tutorial, so try it. If your application needs more RDBMS request, improve your mapping and use hibernate in a more complex way.

Productivity speaking, Hibernate isn't a good bet for what you described.

It's up to you.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 14, 2003 11:51 am 
Newbie

Joined: Thu Sep 25, 2003 11:09 am
Posts: 6
Location: Auburn Hills, MI, USA
Thanks..

I have already built some code as a proof of concept.. I'll build on this and use it as the cache.
When Hibernate gets wider accpetance at our organization, I'll expand the usage of Hibernate in our application.

-Balaji


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