5 Replies Latest reply on Sep 27, 2006 8:50 PM by ben.wang

    PojoCache and getObject()

    sphinxmember

      Hi,

      getObject(fqn) on a PojoCache doesnt trigger a nodevisited event.

      Am I right ??

        • 1. Re: PojoCache and getObject()

          Which version of PojoCache you are running?

          In 1.4, there is an optimization done to getObject such that is BuddyManager is not configured and there is already a Pojo instance stored in the cache system, e.g.,

          cache.putObject(fqn, pojo);
          ...
          cache.getObject(fqn);
          

          then it will bypass the interceptor plus node visit event notification.

          What is the main reason to trigger nodeVisited event?

          If you need to have that, you can turn on buddy replication flag to get that.

          -Ben

          • 2. Re: PojoCache and getObject()
            sphinxmember

            HI,

            I am using Jboss Cache 1.4
            Buddy replication is not configured , My application requirement is such that I need nodeVisited event triggered on getObject call on pojo cache.
            Kindly let me know how to configure it without starting buddy replication.

            Thx

            • 3. Re: PojoCache and getObject()

              Ok, another way to trigger the event notification is to turn on the passivation. That is you configure a regular TreeCache eviction policy plus a cacheloader. When the node is evicted, it will store via the cache loader. This is the recommended way to manage the memory anyway.

              Look at local-passivation-service.xml on how to do that.

              • 4. Re: PojoCache and getObject()
                sphinxmember

                I dont have eviction policy and cacheloader requirement.
                May be at some point of time we might have eviction policy but not cache loader as its loading and storing the cache is achieved differently.

                Is there any other way to trigger it .

                • 5. Re: PojoCache and getObject()

                  Acutally the combination of eviction policy plus cache loader is what we call passivation. Only when you evict the data, do you then store it to the loader store. So the cost is not as much as you think.

                  If you just want to get around this problem, you can set the eviction policy to very long period such that it'd never trigger it. But you will get get event notification. :-)