You're probably on the right track, although I want to clarify: are the entity and its collections something that won't change often? Do you need transactional views on it (i.e. changes made by one session are immediately visible in others)? From your question about caching at Boot it sounds like this may be something that never changes or very infrequently. If it's something that never changes then you may be able to just load it in Boot, touch the collections (to force the lazy retrieval) and then you never need to deal with the "cache" per se anyways.
As for the Hibernate annotations, the only one that's strictly needed to enable caching is @org.hibernate.annotations.Cache What annotations besides that one are you using, and which ones are causing conflicts? There are quite a few that overlap with the JPA standard annotation, so when I use them I usually make specific imports. There are several good articles out there on how to do this out on the web: http://www.gridshore.nl/2008/04/29/using-ehcache-and-verifying-that-it-works-with-jpa-and-springframework/ In particular, it's important to differentiate between the entity cache (enabled with the above annotation) and the query cache. It sounds like you need the former. Derek On Mon, Sep 15, 2008 at 4:20 PM, Tim Perrett <[EMAIL PROTECTED]> wrote: > Hey guys, > > Thanks for your replies. I had a play around with the caching today > and appeared to be getting a whole bunch of conflicts with > org.hibernate.annotations, however these might be resolvable either by > using limited imports to just scrape through with the annotations I > need, or somehow do it with the orm.xml > > Im actually needed to cache an entity that has two collections of > entities (and those collections have zero subsequent collections); I > think a second level cache is appropriate but im not 100% on how to go > about configuring it. Am I on the right path here? > > Effectively, the entity and the collections i want to cache are used > on a request basis so i want to cache them in order to reduce database > load so im working along the lines that the in memory cache will be an > order of magnitude quicker to read from than the DB. > > Lift wise, where should i be looking to load the entities into the > cache - from boot perhaps? Its also unclear how it actually does the > cache (well, i know it stores the dehydrated object), but i mean its > not like you actually have to manually tell the cache to load up the > data so when does it actually do the cache itself? (and how can i > validate its gone in there?) > > Cheers for any pointers > > Tim > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to liftweb@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---