2 Replies Latest reply on Apr 27, 2011 3:16 AM by venkman

    Infinispan as cache in a jboss as6 cluster

    venkman

      Hi there,

       

      i'm trying to learn something about the new infinispan.

       

      I try to start a jboss cluster (AS 6.0.0, 2 nodes on same machine)

       

      and i try to use Infinispan as cluster cache. I want to have a cache, which switches to another node, when the working node crashes.

       

      I wrote a clustered stateful session bean like mentioned here:

       

      http://community.jboss.org/wiki/InfinispanIntegrationinAS6

       

      but how can i handle the Cluster(obejcts)?

       

      I tried this:

       

              GlobalConfiguration gc = new GlobalConfiguration();

              gc.setTransportClass(org.infinispan.remoting.transport.jgroups.JGroupsTransport.class.getName());

              Configuration c = new Configuration();

              c.setCacheMode(Configuration.CacheMode.DIST_SYNC); //<-- here i try several enums

       

              EmbeddedCacheManager cm = new DefaultCacheManager(gc,c);

              cache = cm.getCache();

       

      in the Bean, and wrote getter and setter, but when i kill the clusternode, on which this is running, theres no switching to another node in the cluster. (I think, that's, because i set the Cache Object in the Bean --> Bean has been killed --> Object has been killed) but thats no cluster cache... .

       

      So, how can i implement a cluster cache with infinispan? Have i use xmls, annotations or coding in the bean? I read many of articles here in the Community, but none of  them helps... me.

       

      Can someone please help?

       

      PV