title: Ehcache write-behind caching thread-priority
body: <p>I'm trying to use Ehcache write-behind caching to write batches of transactions to my database. What I need is for the write-behind cache to dump transactions at 5 second intervals (or more often). </p>
  
  <p>I must be missing something, because try as I might, it just won't work. I set up the write-behind caching, and then put load onto the server. Thousands, and then hundreds of thousands of transactions later, and after waiting several minutes, there is still nothing in the database. It isn't until I shut down the load on the server that the cache begins writing to the database.</p>
  
  <p>Is this a problem with thread-priority? Is there a way to modify the Ehcache to perform the DB writes even when the server is under load?</p>
  
  <p>Here is my configuration:</p>
  
  <pre><code>&lt;cache name="server.db.model.Request"
   maxElementsInMemory="10000"
   eternal="false"
   timeToIdleSeconds="5"
   timeToLiveSeconds="5"
   overflowToDisk="false"
   memoryStoreEvictionPolicy="FIFO"&gt;
      &lt;cacheWriter writeMode="write_behind" maxWriteDelay="5" rateLimitPerSecond="5"
       writeCoalescing="true" writeBatching="true" writeBatchSize="5000"
       retryAttempts="2" retryAttemptDelaySeconds="10"&gt;
          &lt;cacheWriterFactory class="server.db.util.RequestCacheWriterFactory"/&gt; 
      &lt;/cacheWriter&gt;
  &lt;/cache&gt;
  </code></pre>
  
  <p>Thanks.</p>