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?
|
|