0 Replies Latest reply on Oct 28, 2010 4:14 AM by Andriy Samulyak

    JBoss cache configuration

    Andriy Samulyak Newbie

      Can ynyone help me with configuring jboss cache to store data in DB.

       

      I added custom configuration to 'jboss-cache-manager-jboss-beans.xml':

       

       

      <entry>
              <key>custom-cache</key>
              <value>
                  <bean name="WCCache" class="org.jboss.cache.config.Configuration">
                      <property name="nodeLockingScheme">PESSIMISTIC</property>
                      <property name="isolationLevel">REPEATABLE_READ</property>
                      <property name="cacheMode">REPL_ASYNC</property>
                      <property name="lockParentForChildInsertRemove">true</property>
                      <property name="lockAcquisitionTimeout">15000</property>
                      <property name="evictionConfig">
                          <bean class="org.jboss.cache.config.EvictionConfig">
                              <property name="wakeupInterval">5000</property>
                              <property name="defaultEvictionRegionConfig">
                                  <bean class="org.jboss.cache.config.EvictionRegionConfig">
                                      <property name="regionName">/</property>
                                      <property name="evictionAlgorithmConfig">
                                          <bean class="org.jboss.cache.eviction.LRUAlgorithmConfig">
                                              <property name="maxNodes">10000</property>
                                              <property name="timeToLive">0</property>
                                              <property name="maxAge">0</property>
                                          </bean>
                                      </property>
                                  </bean>
                              </property>
                          </bean>
                      </property>
                      <property name="cacheLoaderConfig">
                          <bean class="org.jboss.cache.config.CacheLoaderConfig">
                              <property name="passivation">true</property>
                              <property name="shared">false</property>
      
                              <property name="individualCacheLoaderConfigs">
                                  <list>
                                      <bean class="org.jboss.cache.loader.JDBCCacheLoaderConfig">
                                          <property name="datasourceName">java:/DefaultDS</property>
                                          <property name="nodeType">longblob</property>
                                          <property name="async">false</property>
                                          <property name="fetchPersistentState">true</property>
                                          <property name="purgeOnStartup">false</property>
                                          <property name="ignoreModifications">false</property>
                                      </bean>
                                  </list>
                              </property>
                          </bean>
                      </property>
                  </bean>
              </value>
          </entry>
      

       

      the problem is that DataTource deploys after cache start, so while chache deploy I receive error that DS is not boud.

       

      Is there any way to make my cache configuration start after DS is delpoyed?

       

      Thanks