1 Reply Latest reply on Jan 7, 2009 7:22 AM by Manik Surtani

    Region specific cacheloader ?

    u c Newbie

      I am using JBC 3 with local cache and jdbd cache loader, passivation false. I want create a region where I just want to cache data in the memory only, so when evicted the object should not go to the database and another region whose objects should go to database when evicted. I created the following config but when the object gets evcited from the first region (/root/cache/memory in config) JBC is trying to insert the object to database. How can I restrict it.

      <?xml version="1.0" encoding="UTF-8"?>
      <jbosscache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns="urn:jboss:jbosscache-core:config:3.0">
      
      
       <locking isolationLevel="REPEATABLE_READ" lockParentForChildInsertRemove="true" lockAcquisitionTimeout="15000" nodeLockingScheme="mvcc"/>
      
       <eviction wakeUpInterval="60000">
       <!-- Cache wide default -->
       <default algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
       <attribute name="maxNodes">5000</attribute>
       <attribute name="timeToLive">1000000</attribute>
       </default>
      
       <region name="/root/cache/memory" actionPolicyClass="org.jboss.cache.eviction.RemoveOnEvictActionPolicy" >
       <attribute name="maxNodes">50</attribute>
       <attribute name="timeToLive">10000</attribute>
       </region>
      
       <region name="/root/cache" algorithmClass="org.jboss.cache.eviction.LRUAlgorithm" eventQueueSize="200000">
       <attribute name="maxNodes">5</attribute>
       <attribute name="timeToLive">1000</attribute>
       </region>
      
       </eviction>
       <loaders passivation="false" shared="true">
       <!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
       <loader class="org.jboss.cache.loader.JDBCCacheLoader" async="true" fetchPersistentState="true"
       ignoreModifications="false" purgeOnStartup="false">
       <properties>
       cache.jdbc.table.name=jboss_cache
       cache.jdbc.table.create=false
       cache.jdbc.table.drop=false
       cache.jdbc.table.select=true
       cache.jdbc.table.primarykey=cache_id
       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.parent.type=varchar(255)
       cache.jdbc.driver=com.mysql.jdbc.Driver
       cache.jdbc.url=jdbc:mysql://CACHEDATABASE:3333/jboss_cache
       cache.jdbc.user=user
       cache.jdbc.password=password
       cache.jdbc.sql-concat=concat(1,2)
      
       c3p0.maxIdleTime=60
       c3p0.minPoolSize=0
       c3p0.maxPoolSize=40
       c3p0.checkoutTimeout=5000
       cache.jdbc.connection.factory=org.jboss.cache.loader.C3p0ConnectionFactory
      
       </properties>
       </loader>
       </loaders>
      
       </jbosscache>