-->
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: ehCache and caching collections
PostPosted: Tue May 24, 2005 11:06 am 
Newbie

Joined: Mon Mar 21, 2005 12:52 pm
Posts: 11
Location: Chicago, Il
Hibernate 2.1.7:

class ResourceSchedule {

Long objOid; (primary key)
Long resourceOid; (foreign key)
Date startTime;
Date endTime;
String ScheduleType;
}

I would like to use ehCache to handle read/write caching on some very small (but often occuring) transactions. More specifically, I have a collection of resource schedules that relate to a table that currently is going into a hash map, with the key value being resourceOid. Since memory is cheap, querying for the 3000 or so active schedule types and putting them into a hash right away costs so much less then doing a series of smaller database transactions in cpu time.

The problem is I don't know how to tell ehCache to do such a thing. should I explicity create a cache during runtime and insert the resource schedules myself? Can I cache a collection of resource schedules indexed on the foreign key instead of by primary key (or the value ehcache uses)?

_________________
where's my coffee mug?


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 24, 2005 12:04 pm 
Newbie

Joined: Mon Mar 21, 2005 12:52 pm
Posts: 11
Location: Chicago, Il
I apologize, I should clarify:

I have a collection mapped from resource to resource schedule, and its retreiving that collection by the object id of the resource that I'd like to cache.

If possible, I would like to throw data into the cache before any actual transactions take place.

Would doing that open up a big can of worms?

_________________
where's my coffee mug?


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.