Start the test. 1. Start TC Server from POC_INSTALL_DIR as follows : mvn tc:start 2. Start POC by running "mvn tc:run" 3. The POC is a user interactive program. POC at work : 1. Application will give user the menu to either store data on a terracotta clustered cache instance or a non-clustered cache instance. 2. In either case user will be asked to enter a new record or view existing records. 3. a. Entering a new record in clustered cache. b. list down the elements in clustered cache to confrim the entry. c. exit the application and restart it. d. This time just list down the contents of clustered cache. e. you will find the entry from the previous run is listed. f. Terracotta clustered caches persist beyond JVM restarts. 4. a. run two instances of application. b. Enter a record in the clustered cache on instance 1. c. List down the records in clustered cache on instance 2. d. Record entered on instance 1 is available and listed on instance 2. e. Terracotta clustered cache is available across the JVMs. 5. By default second level caching and query cache is enabled with this example. show_sql_queries is also turned on and hence in case of cache hits, users will notice no sql being fired and instead the entities are recovered from the second level ehcache. Important points : 1. By default ALL_CACHE_MANAGERS field which is a static List in CacheManager.java is clustered. Their is no API in cache manager to access this field directly. 2. By Default the singleton cachemanager field in CacheManager.java is clustered and can be obtained by using CacheManager.getInstance() or CacheManager.create() methods. 3. Beyond 2.7.2 releases of terracotta the propery ehcache.clusterAllCacheManagers when set to false will not cluster the above two roots. In this case teh cachemanagers need to be explicitly be defined inside the tc-config.xml of teh application. 4. non-strict-read-write cache (and not read-write) must be used as the cache level in entiy's hbm files. This is because terracotta inheretently provides correctness and adding an extra level of protection obviously involves a performance hit. Use Cases : 1. The sample application demonstrates a clustered EhCache Manager (which is not a default singleton CacheManager inside CacheManager.java). 2. The sample application demonstrates a non-clustered ehcache manager.