Repeated Calls of NearCache.getAll() Returns Different Copies of a Cached Object When the Cache is Configured with an Invalidation Strategy of "none" (Doc ID 1304168.1)

Last updated on NOVEMBER 03, 2016

Applies to:

Oracle Coherence - Version 3.6.1 and later
Information in this document applies to any platform.
***Checked for relevance on 22-Aug-2013***

Symptoms

When you call getAll() repeatedly on a near cache and the underlying cache objects have not changed, the same Java objects should be returned.

Consider an example where there is a single object in the cache.  In the case where invalidation strategy is none, the first getAll() call returns a different object from all of the subsequent getAll() calls, which is incorrect behaviour.  For all other invalidation strategies, the same object is always returned, which is the correct behaviour.

When comparing Java objects, note that "==" compares references and not values, and the equals() method compares the internal values.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms