I have a component deployed to AS 7.1.3.final that programmatically configures a cache manager. From the log it seems like infinispan is establishing a cluster (through jgroups) between two nodes I start on the same machine, with port-offset of 1000.
17:40:43,542 INFO [org.infinispan.remoting.transport.jgroups.JGroupsTransport] (Incoming-1,null) ISPN000094: Received new cluster view: [node1/cluster|1] [node1/cluster, node2/cluster]
However when changes occur to the cache on one node, they don't appear in the cache when accessed on the other node.
The code is:
GlobalConfiguration glob = new GlobalConfigurationBuilder() .nonClusteredDefault() //Helper method that gets you a default constructed GlobalConfiguration, preconfigured for use in LOCAL mode .globalJmxStatistics().enable() //This method allows enables the jmx statistics of the global configuration. .jmxDomain("...") //prevent collision with non-transactional carmart .transport().defaultTransport() .build(); //Builds the GlobalConfiguration object Configuration loc = new ConfigurationBuilder() .jmxStatistics().enable() //Enable JMX statistics .clustering().cacheMode(CacheMode.REPL_SYNC) //Set Cache mode to LOCAL - Data is not replicated. .transaction().transactionMode(TransactionMode.TRANSACTIONAL).autoCommit(false) //Enable Transactional mode with autocommit false .lockingMode(LockingMode.PESSIMISTIC).transactionManagerLookup(new GenericTransactionManagerLookup()) //uses GenericTransactionManagerLookup - This is a lookup class that locate transaction managers in the most popular Java EE application servers. If no transaction manager can be found, it defaults on the dummy transaction manager. .locking().isolationLevel(IsolationLevel.REPEATABLE_READ) //Sets the isolation level of locking .eviction().strategy(EvictionStrategy.NONE) .loaders().passivation(false).addFileCacheStore().purgeOnStartup(true) //Disable passivation and adds a FileCacheStore that is purged on Startup .build(); //Builds the Configuration object
This config was based on one of the infinispan quickstarts, although I changed it from CacheMode.LOCAL to REPL_SYNC, which also required the transport to be set on the GlobalConfiguration. Locking mode was also changed to PESSIMISTIC as my code uses explicit locking, and it complained that explicit locking couldn't be performed with optimistic locking mode.
Any suggestions on what might be wrong would be appreciated.