1 Reply Latest reply: Dec 21, 2012 6:16 AM by user123799 RSS

    Shoudn't 'put with expiry' throw with read-write backing map?

    user123799
      Good morning all,

      If I run this client code:
      cache.put(1,  1, CacheMap.EXPIRY_NEVER);
      I'd expect this entry to never expire. Yet with a read-write backing map it does - immediately, which lead me to digging a bit more...

      According to the [java docs|http://download.oracle.com/otn_hosted_doc/coherence/330/com/tangosol/net/NamedCache.html#put%28java.lang.Object,%20java.lang.Object,%20long%29] support for this call is patchy:

      >
      Note: Though NamedCache interface extends CacheMap, not all implementations currently support this functionality.

      For example, if a cache is configured to be a replicated, optimistic or distributed cache then its backing map must be configured as a local cache. If a cache is configured to be a near cache then the front map must to be configured as a local cache and the back map must support this feature as well, typically by being a distributed cache backed by a local cache (as above.)
      >

      OK, so the docs even say this won't work. But shouldn't it throw an unsupported op exception? Is this a bug or my mistake?

      rw-scheme config:
      <backing-map-scheme>
        <read-write-backing-map-scheme>
           <internal-cache-scheme>
              <local-scheme/>
           </internal-cache-scheme>
           <cachestore-scheme>
               ...
          </cachestore-scheme>
          <write-delay>1ms</write-delay>
        </read-write-backing-map-scheme>
      </backing-map-scheme>
      Edited by: BigAndy on 04-Dec-2012 04:28