Configure JPA/Hibernate to run with Infinispan
Configuration 1. First of all, to enable JPA/Hibernate second level cache with query result caching enabled (Note: Query result caching, or for that matter entity caching, may not improve application performance. Be sure to benchmark your application with and without caching.), add either of the following: true true  2. Now, configure the Infinispan cache region factory using one of the two options below:  • If the Infinispan CacheManager instance happens to be bound to JNDI select JndiInfinispanRegionFactory as the cacheregion factory and add the cache manager’s JNDI name:    org.hibernate.cache.infinispan.JndiInfinispanRegionFactory   java:CacheManager  Important note: JBoss Application Server might at some point have a common Infinispan cache manager that can be shared by all services but as of AS 6.0.0 M3 this yet not true. If you still want to deploy Infinispan 2LC this way, make sure you bind the CacheManager to JNDI. For more info on this, check the technical FAQ wiki.  • If running JPA/Hibernate and Infinispan standalone or within third party Application Server, select InfinispanRegionFactory as the cache region factory:    org.hibernate.cache.infinispan.InfinispanRegionFactory  This is all the configuration you need to run JPA/Hibernate with the Infinispan cache provider with the default settings. This should suit the majority of use cases but sometimes, further configuration is required and to help with such situations, please check the following section where more advanced settings are discussed.