1 Reply Latest reply on Aug 4, 2015 3:41 AM by rvansa

    Infinispan - JCache annotations - Remote cache

    german.tejero

      I want to use JCache annotations with remote infinispan cache through HotRod.


      I define javax.cache.spi.CachingProvider to org.infinispan.jcache.remote.JCachingProvider.


      In a method, when i use jcache without annotations, the remote chaching provider is used.


      CachingProvider proveedor = Caching.getCachingProvider();

      CacheManager manejador = proveedor.getCacheManager();

      Cache cache = manejador.getCache("persona");


      But when i use jcache annotations, the embedded cache provider is used.


      @Stateless

      @CacheDefaults(cacheName = "persona")

      public class Servicio {

       

          @Inject

          private Datos datos;

         

          @CacheResult

          public Modelo obtener(@CacheKey Integer c)...

       

      Is posible use remote cache with jcache annotations?

      How?

       

      Thanks to all!

        • 1. Re: Infinispan - JCache annotations - Remote cache
          rvansa

          What's on your classpath? Check that you have infinispan-jcache-remote-version.jar there and not infinispan-jcache-embedded-version.jar. In case you need both (and don't want to use special classloaders for them), you have to specify fully qualified name, in your case org.infinispan.jcache.remote.JCachingProvider.