I am considering implementing L2caching myself with openjpa. Since it is open source and there is little L2 caching support at the moment I thought I might as well just do it.
Reading the doc I first found the RemotCommitProvider stuff - but this is not what I am looking for. It seems to be about communicating events to other server in some distributed scenario. But this type of functionality is already provided by any caching system already. So I have no need for it and I intend to let the cache do that itself... So I should have zero need to implement this type of functionality. I am not trying to reinvent caching - this has been done and well done before. Maybe this was done to support the custom openjpa caching stuff - I don't know. But to integrate with a JCache - all I need to know is where the get and put calls are made - and that's it. All I need is to find the hook where openjpa decide to check the cache for content and where openjpa put something in the cache. For example - in the case of a simple object graph - I would assume that when I select the parent object - openjpa will check the cache: - 1 - Is the parent in the L2 cache. - 2 - are the related objects in the L2 cache (based on cascade.select etc..). I am also assuming the cache check arre always done at the entity type granularity level. By that I mean I do one check for the parent object - and I do one check (and only one) for all the same entity type children (in a one to many scenario) (basically I want to do a getAll() of course). So there must be a piece of code somewhere that do the get and put in the L2 cache. I mean openjpa does all the complicated stuff - relationship mapping - dynamic sql query - etc... All I need is L2 cache support. If my assumptions are correct about how openjpa talks to a l2cache - then I should be able to do proper L2 cache support in no time at all... I mean gosh if it is designed properly the whole thing can be done in less than a day. Am I missing something? Can anyone tell me where to look to find the L2 cache calls being made? I already know the RemoteCommitProvider is not done for that at all - so where should I look? Frederic
