2 Replies Latest reply on Jul 28, 2016 10:21 AM by Tao Lang

    Cache nodes in cluster write to shared DB store at the same time in batching mode even "shared" is set to ture

    Tao Lang Newbie

      Hi,

       

      I have replicated async cache configured in a cluster with shared db store, I have set the db store attribute shared="true" so only the node where the modification originated will write to the db. However after I enabled batching mode, I noticed all the nodes started write to db at the same time and getting unique constraint error from some nodes, even when I just add a cache entry without using a transaction. Below is the config for my cache, not sure if I did anything wrong. Can you please advise?

       

      <replicated-cache name="repl" mode="ASYNC">
            <transaction mode="BATCH"/>
           <locking acquire-timeout="30000" concurrency-level="1000" striping="false"/>
              <eviction strategy="LRU" max-entries="10000"/>
              <persistence passivation="false">
          <string-keyed-jdbc-store shared="true">
             <data-source jndi-url="/jdbc/cacheregion" />
             <string-keyed-table drop-on-exit="true" create-on-start="true" prefix="${jdbc.table.name.prefix}">
                <id-column name="ID" type="VARCHAR(255)" />
                <data-column name="DATA" type="BLOB" />
                <timestamp-column name="TIMESTAMP" type="NUMBER(19)" />
             </string-keyed-table>
             <write-behind flush-lock-timeout="1" modification-queue-size="1024" shutdown-timeout="25000" thread-pool-size="4"/>
          </string-keyed-jdbc-store>
        </persistence>
           </replicated-cache>
      

       

       

      Thanks

      Tao