Transient Entries

  GigaSpaces 5.X

Documentation Home
Quick Start Guide
Release Notes

Previous release

  Search Here
Searching GigaSpaces Platform 5.X Documentation

                                               

Summary: How to specify that some objects in a persistent space should not be saved to persistent storage.

This page is specific to:
GigaSpaces 5.x

If you're interested in another version, click it below:
GigaSpaces 6.0
GigaSpaces 6.5

Overview

When using a persistent space there are situations where not all the Entries need to be stored in the persistent store. You can define the Entry to be stored only in the space cache, without storing it also in the persistent store, by setting its persistent mode to false. This setting must be specified when the Entry has been created and before it has been written to the space. After the Entry has been written to the space you cannot change its persistent mode.

Transient Entries are treated the same as persistent objects, but when you call the write operation, only persistent Entries are saved to the persistent store. All space operations, including batch operations, are valid for transient Entries.

Non-Mirrored Entries
When using the Mirror Service or the CacheStore interface, you might not want to replicate all space Entries into the mirror service to be persistent or to be delivered to some external data source.

The mirror service/CacheStore do not persist or deliver to external data source an Entry that has been identified as transient.

Transient Entries can be constructed by extending your Entry class from com.j_spaces.core.client.MetaDataEntry, and calling the MataDataEntry.makeTransient() method when constructing the Entry.

When persisting a space using the JDBC SA or an indexed file, the notify registrations are persisted together with the space Entries by default. This allows the space to re-register itself in case it recovers from the database when the client is still alive, and the registration lease has not expired.

If you do not desire this behavior, construct transient notify registration. In this case, the space doesn't persist the notify registration.

Transient Entries must implement the IMetaDataEntry or extend the MetaDataEntry classes.

When the space memory usage control is turned on, a transient Entry might be evicted from the space cache.

Having an Entry with persistent mode = true with memory (transient) based spaces, will not generate any errors or exceptions, but will not write these into any persistent store. The Entries will be transient.

The following methods in the com.j_spaces.core.client.IMetaDataEntry and com.j_spaces.core.client.MetaDataEntry classes allows you to set the Entry persistent/transient mode:

Return Value Method
boolean isTransient()
Returns true if this Entry is a transient Entry (as opposed to a persistent Entry).
void makePersistent()
Makes this Entry a persistent Entry. Can be called only if the Entry has not been written yet to the space.
void makeTransient()
Makes this Entry a transient Entry.

The ExternalEntry provides the same methods to control transient Entries.


Wiki Content Tree


Your Feedback Needed!

We need your help to improve this wiki site. If you have any suggestions or corrections, write to us at techw@gigaspaces.com. Please provide a link to the wiki page you are referring to.

Labels

 
(None)