7 Replies Latest reply: Jun 26, 2013 2:05 PM by 910278 RSS

    Strange LOG  Expected an  insert/update for ... but none have been received

    923032
      Hi,
      I've a strange log when I write/update on a map.


      *2012-03-13 15:58:54.711/13.396 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=1): Expected an insert/update for [B@46b113c7, but none have been received*


      I've seen that if I use default cache-config file, I've no problem. Instead if I use one defined by me there is the strange log.

      I've tried to change completely my own file adding the default cache of default file:

      <distributed-scheme>
            <scheme-name>example-distributed</scheme-name>
            <service-name>DistributedCache</service-name>

            <backing-map-scheme>
              <local-scheme>
                <scheme-ref>example-binary-backing-map</scheme-ref>
              </local-scheme>
            </backing-map-scheme>

            <autostart>true</autostart>
          </distributed-scheme>


      <local-scheme>
            <scheme-name>example-binary-backing-map</scheme-name>

            <eviction-policy>HYBRID</eviction-policy>
            <high-units>{back-size-limit 0}</high-units>
      <unit-calculator>BINARY</unit-calculator>
      <expiry-delay>{back-expiry 1h}</expiry-delay>

      <cachestore-scheme></cachestore-scheme>
      </local-scheme>



      But the log appears.


      Is there someone with some indications about?




      This is my cache-config.xml



      <?xml version="1.0"?>

      <cache-config
           xmlns="http://xmlns.oracle.com/coherence/coherence-cache-config"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

      >

           <caching-scheme-mapping>
                
                <!--
                     This specific cache is so built:
                          Key      = map name (without marker)
                          Value     = marker that describes hint configuration
                -->
                <cache-mapping>
                     <cache-name>caches_index</cache-name>
                     <scheme-name>rhv</scheme-name>
                </cache-mapping>

                <!-- Hint Based Configuration -->
                
                <!-- Access Pattern: ReadMostly,Write Mostly      -->
                <!-- Availability: None,Low,High                -->
                <!-- Persistence:      None,Low,High                -->
                
                <cache-mapping>
                     <cache-name>rnv_*</cache-name>
                     <scheme-name>rnv</scheme-name>
                </cache-mapping>
                
                <cache-mapping>
                     <cache-name>rlv_*</cache-name>
                     <scheme-name>rlv</scheme-name>
                </cache-mapping>

                <cache-mapping>
                     <cache-name>rhv_*</cache-name>
                     <scheme-name>rhv</scheme-name>
                </cache-mapping>
                
                <cache-mapping>
                     <cache-name>rlp_*</cache-name>
                     <scheme-name>rlp</scheme-name>
                </cache-mapping>

                <cache-mapping>
                     <cache-name>rhp_*</cache-name>
                     <scheme-name>rhp</scheme-name>
                </cache-mapping>
                
                <cache-mapping>
                     <cache-name>wnv_*</cache-name>
                     <scheme-name>wnv</scheme-name>
                </cache-mapping>
                
                <cache-mapping>
                     <cache-name>wlv_*</cache-name>
                     <scheme-name>wlv</scheme-name>
                </cache-mapping>
                
                <cache-mapping>
                     <cache-name>whv_*</cache-name>
                     <scheme-name>whv</scheme-name>
                </cache-mapping>
                
                <cache-mapping>
                     <cache-name>whp_*</cache-name>
                     <scheme-name>whp</scheme-name>
                </cache-mapping>
                
                <cache-mapping>
                     <cache-name>wlp_*</cache-name>
                     <scheme-name>wlp</scheme-name>
                </cache-mapping>
           
                          
           </caching-scheme-mapping>

           <caching-schemes>
           
                <distributed-scheme>
                     <scheme-name>wnv</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <backup-count>1</backup-count>
                     <backing-map-scheme>
                <local-scheme> <scheme-ref>localN</scheme-ref>
           </local-scheme>
                </backing-map-scheme>               
           <autostart>true</autostart>
                     <unit-calculator>FIXED</unit-calculator>
                </distributed-scheme>
                
                <distributed-scheme>
                     <scheme-name>wlv</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <backup-count>2</backup-count>
                     <backing-map-scheme>
                <local-scheme><scheme-ref>localL</scheme-ref>
           </local-scheme>
                </backing-map-scheme>               
           <autostart>true</autostart>
                     <unit-calculator>FIXED</unit-calculator>
                </distributed-scheme>
                
                <distributed-scheme>
                     <scheme-name>whv</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <backup-count>3</backup-count>
                     <backing-map-scheme>
                <local-scheme><scheme-ref>localH</scheme-ref>
           </local-scheme>
                </backing-map-scheme>               
           <autostart>true</autostart>
                     <unit-calculator>FIXED</unit-calculator>
                </distributed-scheme>
                
                <distributed-scheme>
                     <scheme-name>whp</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <backup-count>3</backup-count>
                     <backing-map-scheme>
                <local-scheme><scheme-ref>local_store</scheme-ref>
           </local-scheme>
                <!--<cachestore-scheme> </cachestore-scheme> -->
                </backing-map-scheme>               
           <autostart>true</autostart>
                     <unit-calculator>FIXED</unit-calculator>
                </distributed-scheme>
                
                <distributed-scheme>
                     <scheme-name>wlp</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <backup-count>1</backup-count>
                     <backing-map-scheme>
                <local-scheme><scheme-ref>local_store</scheme-ref>
           </local-scheme>
                <!--<cachestore-scheme> </cachestore-scheme> -->
                </backing-map-scheme>               
           <autostart>true</autostart>
                     <unit-calculator>FIXED</unit-calculator>
                </distributed-scheme>
                
                
                
                <!-- Default backing map -->
                
                <distributed-scheme>
                     <scheme-name>backing_map</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <backup-count>1</backup-count>
                     <backing-map-scheme>
                <local-scheme><scheme-ref>localH</scheme-ref>
           </local-scheme>
                </backing-map-scheme>               
           <autostart>true</autostart>
                </distributed-scheme>
                
                <distributed-scheme>
                     <scheme-name>backing_store</scheme-name>
                     <service-name>DistributedCache</service-name>
                     <backup-count>1</backup-count>
                     <backing-map-scheme>
                <local-scheme><scheme-ref>localH</scheme-ref>
                     <!--<cachestore-scheme> </cachestore-scheme> -->
           </local-scheme>
                </backing-map-scheme>               
           <autostart>true</autostart>
                </distributed-scheme>
                
           
                <near-scheme>
                     <scheme-name>rnv</scheme-name>
                               <invalidation-strategy>auto</invalidation-strategy>
                     <front-scheme>
                     <local-scheme>
                               <scheme-ref>localN</scheme-ref>
                     </local-scheme>
                     </front-scheme>
                     <back-scheme>
                     <distributed-scheme>
                     <scheme-ref>backing_map</scheme-ref>     
                     </distributed-scheme>
                     </back-scheme>
                     <autostart>true</autostart>
                </near-scheme>
                
                <near-scheme>
                     <scheme-name>rlv</scheme-name>
                               <invalidation-strategy>auto</invalidation-strategy>
                     <front-scheme>
                     <local-scheme>
                               <scheme-ref>localL</scheme-ref>
                     </local-scheme>
                     </front-scheme>
                     <back-scheme>
                     <distributed-scheme>
                     <scheme-ref>backing_map</scheme-ref>     
                     </distributed-scheme>
                     </back-scheme>
                     <autostart>true</autostart>
                </near-scheme>
                
                <near-scheme>
                     <scheme-name>rhv</scheme-name>
                               <invalidation-strategy>auto</invalidation-strategy>
                     <front-scheme>
                     <local-scheme>
                               <scheme-ref>localH</scheme-ref>
                     </local-scheme>
                     </front-scheme>
                     <back-scheme>
                     <distributed-scheme>
                     <scheme-ref>backing_map</scheme-ref>     
                     </distributed-scheme>
                     </back-scheme>
                     <autostart>true</autostart>
                </near-scheme>

                <near-scheme>
                     <scheme-name>rlp</scheme-name>
                               <invalidation-strategy>auto</invalidation-strategy>
                     <front-scheme>
                     <local-scheme>
                               <scheme-ref>localL</scheme-ref>
                     </local-scheme>
                     </front-scheme>
                     <back-scheme>
                     <distributed-scheme>
                     <scheme-ref>backing_store</scheme-ref>     
                     </distributed-scheme>
                     </back-scheme>
                     <autostart>true</autostart>
                </near-scheme>          

                <near-scheme>
                     <scheme-name>rhp</scheme-name>
                               <invalidation-strategy>auto</invalidation-strategy>
                     <front-scheme>
                     <local-scheme>
                               <scheme-ref>localH</scheme-ref>
                     </local-scheme>
                     </front-scheme>
                     <back-scheme>
                     <distributed-scheme>
                     <scheme-ref>backing_store</scheme-ref>     
                     </distributed-scheme>
                     </back-scheme>
                     <autostart>true</autostart>
                </near-scheme>               
           
           <!-- Local Schemes -->     

           <local-scheme>
           <scheme-name>localN</scheme-name>
           <eviction-policy>HYBRID</eviction-policy>
           <high-units>100m</high-units>
           <low-units>75m</low-units>     
                <expiry-delay>20m</expiry-delay>
                <unit-calculator>FIXED</unit-calculator>          
           </local-scheme>

           
           <local-scheme>
           <scheme-name>localL</scheme-name>
           <eviction-policy>HYBRID</eviction-policy>
           <high-units>200m</high-units>
           <low-units>150m</low-units>
           <unit-calculator>FIXED</unit-calculator>
           <expiry-delay>1h</expiry-delay>
           </local-scheme>
                          
           
           <local-scheme>
           <scheme-name>localH</scheme-name>
           <eviction-policy>HYBRID</eviction-policy>
           <high-units>0</high-units>
           <low-units>0</low-units>
           <unit-calculator>FIXED</unit-calculator>
           <expiry-delay>1d</expiry-delay>
           </local-scheme>     
                
                
                <local-scheme>
           <scheme-name>local_store</scheme-name>
           <eviction-policy>HYBRID</eviction-policy>
           <high-units>0</high-units>
           <low-units>0</low-units>
           <unit-calculator>FIXED</unit-calculator>
           <expiry-delay>1d</expiry-delay>
           </local-scheme>     

      </caching-schemes>

      </cache-config>
        • 1. Re: Strange LOG  Expected an  insert/update for ... but none have been received
          user738616
          Hi,
          2012-03-13 15:58:54.711/13.396 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=1): Expected an insert/update for [B@46b113c7, but none have been received
          I think the problem is not with the cache configuration but with buggy or missing equals/hashCode implementation in the key class that you are trying to store in the cache. The message means that near cache was expecting an update event for an item that was in the front of the cache after a put or putAll. If a put is done to a near cache, the put is invoked against the back of the cache. If the item is in the front, then that put to the back should generate an update event but no update event was received. Hope this helps!Cheers,NJ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
          • 2. Re: Strange LOG  Expected an  insert/update for ... but none have been received
            923032
            The strange thing is that it happens with all types of cache, not only near cache.
            • 3. Re: Strange LOG  Expected an  insert/update for ... but none have been received
              user738616
              920029 wrote:
              The strange thing is that it happens with all types of cache, not only near cache.
              Interesting! Please paste the hashcode/equals method of some of your object keys.

              Cheers,
              NJ
              • 4. Re: Strange LOG  Expected an  insert/update for ... but none have been received
                drakitine
                2012-03-13 15:58:54.711/13.396 Oracle Coherence GE 3.7.1.0 <Info> (thread=main, member=1): Expected an insert/update for [B@46b113c7, but none have been received This message is logged by the near cache implementation, usually when keys do not implement equals/hashCode correctly. The key - [B@46b113c7 is a byte array which certainly does not implement equals/hashCode at all.Regards,Dimitri                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   
                • 5. Re: Strange LOG  Expected an  insert/update for ... but none have been received
                  923032
                  You are right.
                  I'm forced to use byte array in my coherence maps due to legacy API I've to respect.


                  Is this a limitation to the use of the coherence?

                  Can use them or I have no way to use it in my application?
                  • 6. Re: Strange LOG  Expected an  insert/update for ... but none have been received
                    drakitine
                    Is this a limitation to the use of the coherence?
                    No, it's a limitation of Java arrays - they cannot be used as hastable keys. For example:
                                    Map map = new HashMap();
                                    Object key1 = new byte[] { 1, 2, 3, 4 };
                                    Object key2 = new byte[] { 1, 2, 3, 4 };
                                    map.put(key1, "foo");
                                    map.put(key2, "bar");
                                    System.out.println(map.size());
                    will print 2.
                    Can use them or I have no way to use it in my application?
                    You can if you use distributed cache which only uses serialized keys. If you need to use near cache you will have to write a simple wrapper.

                    Regards,
                    Dimitri
                    • 7. Re: Strange LOG  Expected an  insert/update for ... but none have been received
                      910278

                      Just wanted to say thank you.

                      I ran into the same problem (the log messages), and would never have guessed it has anything to do with the equality validity. And of course, the key for this particular cache was just missing equals()/hashCode() all together.