[hibernate-dev] 2nd-level cache suggestions

Alex Besogonov cyberax at staffdirector.net
Tue Apr 1 10:14:53 EDT 2008


Max Rydahl Andersen wrote:
>> 1. I think it's possible to add a manual collection cache entry update
>> in the postAction() callback. And it'll probably work.
> How would you ensure that the cache is consistent ?
Not a problem. Dirty extra lazy collections are already evicted from the 
cache during the flush.

And by the time postAction() is executed I can determine if I can safely 
put my collection into the cache.

> "extra lazy collections" is kinda opposite to what "cached collections" is about...
> I fail to see the problem...
I don't exactly have a usual extra lazy collection. My collection 
eagerly loads the _keys_ of its elements and then lazily creates the 
elements when it's required.

So I have a bit more possibilities then a pure extra-lazy collection.

>> 3. This is a fairly large task, which requires changing some of
>> Hibernate fundamentals (like LoadEvent). But I think I can do it.
> Have you looked in Hibernate 3.3 and checked if the recent refactorings
> that were done here for the cache api is enough for you ?
Unfortunately, the refactored API still does not support bulk loading.

-- 
With respect,
             Alex Besogonov (cyberax at staffdirector.net)



More information about the hibernate-dev mailing list