2 Replies Latest reply on Apr 28, 2014 10:32 AM by prashant.thakur

    Configure Time interval to persist data in storage

    deeal

      Hello

       

      I am using JDBCCacheLoader to persist the data present in cache to DB.

      The configuration is:

       

      <cacheloader>

                          <class>org.jboss.cache.loader.JDBCCacheLoader</class>

                          <!-- same as the old CacheLoaderConfig attribute -->

                          <properties>

                              cache.jdbc.table.name=SCHEMA.JBOSS_CACHE_DATA

                              cache.jdbc.table.create=false

                              cache.jdbc.table.drop=false

                              cache.jdbc.table.primarykey=jbosscache_pk

                              cache.jdbc.fqn.column=fqn

                              cache.jdbc.fqn.type=varchar2(3000)

                              cache.jdbc.node.column=node

                              cache.jdbc.node.type=blob

                              cache.jdbc.parent.column=parent

                               cache.jdbc.datasource=ABC/DB-BASIC

                              cache.jdbc.sql-concat=concat(1,2)

                                 cache.jdbc.connection.factory=org.jboss.cache.loader.C3p0ConnectionFactory

                                 c3p0.maxPoolSize=20

                                 c3p0.checkoutTimeout=20000

                          </properties>

                          <!-- whether the cache loader writes are asynchronous -->

                          <async>true</async>

                          <!-- only one cache loader in the chain may set fetchPersistentState

                      to true. An exception is thrown if more than one cache loader

                  sets this to true. -->

                          <fetchPersistentState>true</fetchPersistentState>

                          <!-- determines whether this cache loader ignores writes - defaults

                      to false. -->

                          <ignoreModifications>false</ignoreModifications>

                          <!-- if set to true, purges the contents of this cache loader when the

                      cache starts up. Defaults to false.  -->

                          <purgeOnStartup>false</purgeOnStartup>

                      </cacheloader>

       

      What I observed that on each write to cache will trigger an update query to persist data in DB.

      I did quiet research to find out whether I can configure the interval to write to DB, but went in vain....

       

      Is there any way that I can configure this property.