Cache Semantics


Coherence caches are used to cache value objects. These objects may represent data from any source, either internal (session data, transient data, etc...) or external (database, mainframe, etc...).

Objects placed in the cache must be capable of being serialized. The simplest approach to doing this is to implement For higher performance, Coherence also supports the and (even faster) interfaces. The primary difference between Externalizable and ExternalizableLite is the I/O stream used. In most cases, porting from one to the other is a trivial exercise.

Any objects that implement will automatically support ExternalizableLite. For more details, see the API JavaDoc for

As a reminder, when serializing an object, Java serialization automatically crawls every object visible (via object references, including collections like Map and List). As a result, cached objects should not refer to their parent objects directly (holding onto an identifying value like an integer is okay). Of course, objects that implement their own serialization routines do not need to worry about this.