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("org.infinispan.demo.carmart.tx") //prevent collision with non-transactional carmart
.build(); //Builds the GlobalConfiguration object
Configuration loc = new ConfigurationBuilder()
.jmxStatistics().enable() //Enable JMX statistics
.clustering().cacheMode(CacheMode.LOCAL) //Set Cache mode to LOCAL - Data is not replicated.
.transaction().transactionMode(TransactionMode.TRANSACTIONAL).autoCommit(false) //Enable Transactional mode with autocommit false
.lockingMode(LockingMode.OPTIMISTIC).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