4 Replies Latest reply on Mar 12, 2009 5:15 AM by krishnan366

    Timeout on node -- possible??

    krishnan366

      I am using jboss cache 3.0.2 for one of my projects and using the JDBCCacheLoader for eviction.

      I would like to know if there is an option to set a timeout on each node. The requirement is that when this timeout is reached the node must be removed from both memory and database and should not be accessible.. How do I achieve this?

        • 1. Re: Timeout on node -- possible??
          manik

          Configure an expiration policy. This way you can specify when objects expire. In addition, you should change the EvictionActionPolicy from the default (only evict from memory) to the RemoveOnEvictActionPolicy.

          • 2. Re: Timeout on node -- possible??
            krishnan366

            Hi Manik,
            Thanks for the response. I am using cache-config.xml to set the cache configuration options. How do I change to RemoveOnEvictActionPolicy in the config file .

            Also the node should also be saved to database if the cache memory exceeds or may be when the number of nodes exceed a certain limit. This is right now configured and is working fine.

            Can this be coupled with the RemoveOnEvictActionPolicy to achieve both ?


            • 3. Re: Timeout on node -- possible??
              krishnan366

              Thanks Manik, I was able to find out on configuring RemoveOnEvictActionPolicy. it is as follows

              <region name="/org/jboss/data2" actionPolicyClass="org.jboss.cache.eviction.RemoveOnEvictActionPolicy">
              27 <attribute name="maxNodes">5</attribute> <property name="maxNodes" value="5"/>
              28 <attribute name="timeToLive">4000</attribute> <property name="timeToLive" value="4000"/>
              29 </region> </region>
              




              • 4. Re: Timeout on node -- possible??
                krishnan366

                 

                <region name="/org/jboss/data2" actionPolicyClass="org.jboss.cache.eviction.RemoveOnEvictActionPolicy">
                <property name="maxNodes" value="5"/>
                <property name="timeToLive" value="4000"/>
                </region>