5 Replies Latest reply on Apr 15, 2009 5:41 AM by Manik Surtani

    JDBC Cache Loader always loads from DB

    Srinivasan Bakthavachalam Newbie

      I'm using JBoss Cache 1.4.1 SP8 and JGroups 2.4.1 SP4

      I've configured my cache with JDBC Cacheloader and I see that for each request the cache is loading from the DB inspite of the data residing in the cache.

      At what circumstances this might happen. The configuration i've used is

      <?xml version="1.0" encoding="UTF-8"?>
      
      <server>
      
       <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
      
       <mbean code="org.jboss.cache.TreeCache"
       name="jboss.cache:service=TreeCache">
      
       <depends>jboss:service=Naming</depends>
       <depends>jboss:service=TransactionManager</depends>
      
       <attribute name="NodeLockingScheme">PESSIMISTIC</attribute>
      
       <attribute name="IsolationLevel">READ_COMMITTED</attribute>
      
       <attribute name="CacheMode">REPL_SYNC</attribute>
      
       <attribute name="UseInterceptorMbeans">true</attribute>
      
       <attribute name="UseReplQueue">false</attribute>
      
       <attribute name="ReplQueueInterval">0</attribute>
      
       <attribute name="ReplQueueMaxElements">0</attribute>
      
       <attribute name="ClusterName">Cache-LABS</attribute>
      
       <attribute name="FetchInMemoryState">true</attribute>
      
       <attribute name="ClusterConfig">
       <config>
       <UDP mcast_addr="224.40.50.60" mcast_port="49977"
       ip_ttl="64" ip_mcast="true"
       mcast_send_buf_size="150000" mcast_recv_buf_size="200000"
       ucast_send_buf_size="150000" ucast_recv_buf_size="200000"
       loopback="false" bind_addr="114.94.99.351"/>
       <PING timeout="2000" num_initial_members="3"
       up_thread="false" down_thread="false"/>
       <MERGE2 min_interval="10000" max_interval="20000"/>
       <FD shun="true" up_thread="true" down_thread="true" />
       <FD_SOCK/>
       <VERIFY_SUSPECT timeout="1500"
       up_thread="false" down_thread="false"/>
       <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800"
       max_xmit_size="8192" up_thread="false" down_thread="false" discard_delivered_msgs="true"/>
       <UNICAST timeout="600,1200,2400" window_size="100" min_threshold="10"
       down_thread="false"/>
       <pbcast.STABLE desired_avg_gossip="20000"
       up_thread="false" down_thread="false"/>
       <FRAG frag_size="8192"
       down_thread="false" up_thread="false"/>
       <pbcast.GMS join_timeout="5000" join_retry_timeout="2000"
       shun="true" print_local_addr="true"/>
       <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
       </config>
       </attribute>
      
       <attribute name="SyncReplTimeout">150000</attribute>
      
       <attribute name="LockAcquisitionTimeout">120000</attribute>
      
       <attribute name="CacheLoaderConfiguration">
       <config>
       <passivation>false</passivation>
       <preload>/</preload>
       <shared>true</shared>
       <cacheloader>
       <class>org.jboss.cache.loader.JDBCCacheLoader</class>
       <properties>
       cache.jdbc.table.name=DBCACHE
       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=varchar(255)
       cache.jdbc.node.column=node
       cache.jdbc.node.type=blob
       cache.jdbc.parent.column=parent
       cache.jdbc.datasource=jdbc/basic
       cache.async.batchSize=10000
       cache.async.pollWait=100
       cache.async.returnOld=true
       cache.async.queueSize=100
       cache.async.put=true
       </properties>
       <async>false</async>
       <fetchPersistentState>true</fetchPersistentState>
       <ignoreModifications>false</ignoreModifications>
       <purgeOnStartup>false</purgeOnStartup>
       </cacheloader>
       </config>
       </attribute>
      
       <attribute name="EvictionPolicyClass"></attribute>
      
       </mbean>
      
      </server>
      



      The log messages from jboss are as

      org.jboss.cache.loader.JDBCCacheLoader --> executing sql: select node from DBCACHE where fqn=?


      Please suggest your thoughts on this.