title: hibernate cached query not updated when new record inserted
body: <p>We have a EHCache cluster, hibernate and Mysql.</p>
  
  <p>Everything is working almost fine. Criteria searches are being cached and when records are modified on other members of the clusters the cached queries are updated instantly on the other servers.</p>
  
  <p>however, my problem is when new records are inserted. The cached queries on that table do not know about it until the cached query are expired. </p>
  
  <p>I probably have missed something on my EHcache.xml configuration, but I have no idea what could it be.</p>
  
  <p>Any ideas?</p>
  
  <p>EHCache.xml follows:</p>
  
  <p>`</p>
  
  <pre><code>&lt;!--&lt;diskStore path="java.io.tmpdir"/&gt;--&gt;
  
  &lt;!-- means for cache replication --&gt;
  
  &lt;cacheManagerPeerProviderFactory
      class="net.sf.ehcache.distribution.jgroups.JGroupsCacheManagerPeerProviderFactory"
      properties="connect=
          TCP(bind_port=10700):
          S3_PING(...):
          MERGE2(max_interval=30000;min_interval=10000):
          FD_SOCK(start_port=0):
          FD(timeout=3000;max_tries=3):
          VERIFY_SUSPECT(timeout=1500):
          BARRIER():
          pbcast.NAKACK(use_mcast_xmit=false;gc_lag=0;retransmit_timeout=300,600,1200,2400,4800;discard_delivered_msgs=true):
          UNICAST(timeout=300,600,1200):
          pbcast.STABLE(stability_delay=1000;desired_avg_gossip=50000;max_bytes=400K):
          pbcast.GMS(print_local_addr=true;join_timeout=300;view_bundling=true):
          FC(max_credits=2M;min_threshold=0.10):
          FRAG2(frag_size=60K):
          pbcast.STREAMING_STATE_TRANSFER()"
      propertySeparator="::" /&gt;    
  
  &lt;!-- default query cache to be used for all queries without an explicit cache --&gt;
  
  &lt;cache
      name="org.hibernate.cache.StandardQueryCache"
      maxElementsInMemory="100"
      eternal="false"
      timeToLiveSeconds="600"
      overflowToDisk="false"
      statistics="true"&gt;
      &lt;cacheEventListenerFactory
          class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
          properties="replicateAsynchronously=true, replicatePuts=true,
          replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true" /&gt;
  &lt;/cache&gt;    
  
  &lt;!-- timestamps of particular last update time to tables --&gt;
  
  &lt;cache
      name="org.hibernate.cache.UpdateTimestampsCache"
      maxElementsInMemory="5000"
      eternal="true"
      overflowToDisk="false"
      statistics="true"&gt;
      &lt;cacheEventListenerFactory
          class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
          properties="replicateAsynchronously=true, replicatePuts=true,
          replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true" /&gt;
  &lt;/cache&gt;
  
  &lt;!-- default cache to use for all cacheable entities without an explicit cache --&gt;
  
  &lt;defaultCache
          maxElementsInMemory="10000"
          eternal="false"
          timeToIdleSeconds="600"
          timeToLiveSeconds="600"
          overflowToDisk="false"
          maxElementsOnDisk="10000000"
          diskPersistent="false"
          diskExpiryThreadIntervalSeconds="600"
          memoryStoreEvictionPolicy="LRU"
          statistics="true"&gt;
          &lt;cacheEventListenerFactory
              class="net.sf.ehcache.distribution.jgroups.JGroupsCacheReplicatorFactory"
              properties="replicateAsynchronously=true, replicatePuts=true,
              replicateUpdates=true, replicateUpdatesViaCopy=false, replicateRemovals=true" /&gt;
  &lt;/defaultCache&gt;
  </code></pre>
  
  <p>
  `</p>