3 Replies Latest reply: Jan 8, 2013 9:19 AM by User738616-Oracle RSS

    write-behind cache store events are not invoked

    982729
      Hi,

      I am trying to create a write behind cache in my Web Logic App server (There is a coherence cluster targeting this app server).
      I have given server specific cache config in Server Start 'Arguments' (-Dtangosol.coherence.cacheconfig=/server/appserver/server-cache-config.xml).

      server-cache-config.xml:
      <cache-config>
           <caching-scheme-mapping>
                <cache-mapping>
                     <cache-mapping>
                          <cache-name>MissedTransactionCache</cache-name>
                          <scheme-name>Missed-Transaction-Cache</scheme-name>
                     </cache-mapping>
           </caching-scheme-mapping>
           <caching-schemes>
                <distributed-scheme>
                     <scheme-name>missed-transaction-cache-scheme</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <thread-count>50</thread-count>
                     <backing-map-scheme>
                          <read-write-backing-map-scheme>
                               <scheme-name>TestScheme</scheme-name>
                               <internal-cache-scheme>
                                    <local-scheme>
                                         <scheme-ref>categories-eviction</scheme-ref>
                                    </local-scheme>
                               </internal-cache-scheme>

                               <cachestore-scheme>
                                    <class-scheme>
                                         <class-name>com.example.MissedTransactionCacheStore</class-name>
                                    </class-scheme>
                               </cachestore-scheme>
                               <write-delay>30s</write-delay>
                               <write-batch-factor>0.9</write-batch-factor>
                          </read-write-backing-map-scheme>
                     </backing-map-scheme>
                     <listener>
                          <class-scheme>
                               <class-name>com.example.MissedTransactionCacheListener</class-name>
                          </class-scheme>
                     </listener>
                </distributed-scheme>

                <local-scheme>
                     <scheme-name>categories-noneviction</scheme-name>
                </local-scheme>
           </caching-schemes>
      </cache-config>

      I do not see any exceptions during server start and cache interaction (get,put,etc) even the listener (MissedTransactionCacheListener) events are getting triggered,
      but there are no store operations happening. what am I missing ? Kindly help me on this.

      Thanks
      Maria

      Edited by: Jestina.Nancy on Jan 4, 2013 1:33 AM

      Edited by: Jestina.Nancy on Jan 4, 2013 1:35 AM
        • 1. Re: write-behind cache store events are not invoked
          User738616-Oracle
          Hi Maria,

          This is because you are referring the cache schemes incorrectly.

          <code>

          <cache-mapping>
          <cache-name>MissedTransactionCache</cache-name>
          <scheme-name>Missed-Transaction-Cache</scheme-name>
          </cache-mapping>

          :
          :
          :
          <distributed-scheme>
          <scheme-name>missed-transaction-cache-scheme</scheme-name>
          <service-name>DistributedCache</service-name>


          </code>

          The reference for "Missed-Transaction-Cache" does not exist so you need to replace "missed-transaction-cache-scheme" with "Missed-Transaction-Cache" and same applies to "TestScheme". I don't think this configuration is even getting loaded else you will be get errors so check coherence start logs for configuration file that is loaded.

          HTH

          Cheers,
          _NJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
          • 2. Re: write-behind cache store events are not invoked
            982729
            Hi NJ,

            Sorry about that cache config. It is a typo. My actual config is referring the correct scheme.
            .
            .
            <cache-mapping>
            <cache-name>MissedTransactionCache</cache-name>
            <scheme-name>missed-transaction-cache-scheme</scheme-name>
            </cache-mapping>
            .
            .
            My cache is getting created successfully. As I said earlier it is not not invoking any store event.

            I have tested two scenarios:

            Firstly,
            My Coherence cluster is loaded with different cache config which has no cache stores or loaders. In my app server (server-cache-config.xml referred in previous post) I am giving different cache config. No exceptions !

            Secondly,
            Starting Coherence clusters with the same config as my app server. It thows ClassNotFoundException saying com.example.MissedTransactionCacheStore is not found.


            Hence, it is clear that my classes inside .ear bundle is not getting recognized. Is there any way I can define classpath for those classes ?

            Thanks
            Maria.
            • 3. Re: write-behind cache store events are not invoked
              User738616-Oracle
              Hi Maria,

              You need to create a jar including the classes such as, "com.example.MissedTransactionCacheStore"or your complete EAR in the coherence server classpath using -cp option.
              Secondly,
              Starting Coherence clusters with the same config as my app server. It thows ClassNotFoundException saying com.example.MissedTransactionCacheStore is not found.


              Hence, it is clear that my classes inside .ear bundle is not getting recognized. Is there any way I can define classpath for those classes ?
              HTH

              Cheers,
              NJ