title: Cache region configurations in persistence.xml
body: <p>According to <strong><a href="http://infinispan.org/docs/6.0.x/user_guide/user_guide.html#_jboss_as_and_wildfly" rel="nofollow">this documentation</a></strong>, when using <strong>Infinispan</strong> with Hibernate it is possible to define multiple cache regions and configure them individually. I'm using <strong>WildFly 8.0</strong>, which uses Infinispan as a default 2LC provider for Hibernate. So here's my standalone.xml configuration for hibernate cache container:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;cache-container name="hibernate" default-cache="local-query" module="org.hibernate"&gt;
      &lt;local-cache name="entity"&gt;
          &lt;transaction mode="NON_XA"/&gt;
          &lt;eviction strategy="LRU" max-entries="10000"/&gt;
          &lt;expiration max-idle="100000"/&gt;
      &lt;/local-cache&gt;
      &lt;local-cache name="local-query"&gt;
          &lt;transaction mode="NONE"/&gt;
          &lt;eviction strategy="LRU" max-entries="10000"/&gt;
          &lt;expiration max-idle="100000"/&gt;
      &lt;/local-cache&gt;
      &lt;local-cache name="timestamps"&gt;
          &lt;transaction mode="NONE"/&gt;
          &lt;eviction strategy="NONE"/&gt;
      &lt;/local-cache&gt;
  &lt;/cache-container&gt;
  </code></pre>
  
  <p>So, the max idle expiration time is set to 100 seconds. This is how I tell Hibernate to cache query:</p>
  
  <pre class="lang-java prettyprint-override"><code>slotQuery.setHint("org.hibernate.cacheable", true)
           .setHint("org.hibernate.cacheRegion", "myRegionName")
           .getResultList();
  </code></pre>
  
  <p>Everything is working perfeclty, the queries are being cached for 100 seconds. But when I'm trying to configure a separate cache region for the query in persistence.xml:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;property name="hibernate.cache.use_second_level_cache" value="true"/&gt;
  &lt;property name="hibernate.cache.use_query_cache" value="true"/&gt;
  &lt;property name="hibernate.cache.infinispan.myRegionName.expiration.max_idle" value="5000"/&gt;
  </code></pre>
  
  <p>settings are not being overriden, and the query is cached for 100 seconds. What am I missing here?</p>