Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] using another L2 cache implementation

Hi Yannick,

I've been trying to track down an example for you to look at, but unfortunately there is not one in the open source product.

The idea is that you subclass CacheInterceptor. Unfortunately, you will have to override pretty much every method if you are completely replacing the cache. We have been trying to figure out how to make this it easier to plug in another cache, but unfortunately that work is still in the discussion stages.

CacheInterceptor is designed to replace the identity map, and there is no reason you need the target identity map. You will be replacing every reference to targetIdentityMap in the CacheInterceptor code with a call into your caching solution.

I appologize that is code is not easily overridable at the moment. Hopefully in a future version we'll have a more user-friendly solution.

-Tom

Yannick Majoros wrote:
 Hi,

Thanks!

Just had a look at the source. It could be what I need.

So, what should I do to delegate all caching to, say, ehcache? I guess I should subclass CacheInterceptor and override some specific method (if not about everything). What confuses me is the targetIdentityMap. Should I refer to that in all cases, or could I just implement IdentityMap the way I want and never refer to targetIdentityMap?

Regards,

Yannick


Le 18/07/2011 14:52, Tom Ware a écrit :
Hi Yannick,

  There is no general JPA way of replacing the cache implementation.

EclipseLink offers the possibility of implementation a CacheInterceptor. You provide an implementation of that class that takes the appropriate action when EclipseLink makes calls into the cache.

  Here's the javadoc:

http://www.eclipse.org/eclipselink/api/2.3/org/eclipse/persistence/sessions/interceptors/CacheInterceptor.html

  If you need help implementing, you can get it on this list.

-Tom

Yannick Majoros wrote:
 Hi,

Is there a way to use another L2 cache implementation? I'd like to use some shared cache between multiple servers (ehcache or other). If possible, I'd like to use JPA 2 interfaces rather than eclipselink-specific ones, but the latter is also an option if it's simple enough, or documented/supported.

Regards,

Yannick Majoros
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users

_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top