Hi all -
First, kudos to hibernate. Its the best.
My question - what would be a good (the best?) way to cache a set of objects defined by an HQL query?
As I understand it, if I execute a find() or iterate(), a query will always run to generate object IDs, but the objects themselves may be returned from a cache (per the jcs-cache configs).
I would like to define certain queries which would only be executed in certain cases - such as after an expiration period. I know the query results will rarely change, so I would like to avoid the db load incurred by this query whose results rarely changes.
I've thought about manually cache the results collection. After expiration, re-get the query result, and cache it again.
I've also thought about manually specifying the id set for the results, and just using those ids in the query, instead of restriciting the results within the query.
Is there some more elegant way to accomplish this within hibernate?
Thanks for any advice.
Tyson
|