Skip to content

Other Operations

Jan Wiemer edited this page Dec 29, 2020 · 1 revision

Other Operations

The store provides some more API methods e.g. to access meta information about the objects in the store:

boolean isUpdated(K key);

Returns if the object for the passed key has been marked as updates (the update method has been called) by the current transaction.

boolean isStale(K key);

Returns if the object for the passed key is stale, that is another transaction has committed a version newer than the version stored in the TX-View of the current transaction.

void checkStale(K key) throws JacisStaleObjectException;

Checks if the object for the passed key is stale (see above), and throws an exception if so.

TV refresh(K key);

Refresh the object for the passed key from the committed values and return the refreshed object. Note that all earlier modifications in the current transaction are lost.

TV refreshIfNotUpdated(K key);

If the object is not already marked as updated refresh it for the passed key from the committed values and return the possibly refreshed object. Note that earlier modifications done in the current transaction without calling the update method are lost.

TV getTransactionStartValue(K key);

Returns the value that was valid as the object was first accessed by the current TX (null if untouched).

StoreEntryInfo<K, TV> getObjectInfo(K key);

Returns a info object (type: StoreEntryInfo) containing information regarding the current state of the object (e.g. version and String representation of committed original object and the clone in the current TX-View).

void initStoreNonTransactional(…​)

The initStoreNonTransactional methods can be used to initialize the store with a number of objects that shall exist before the first transaction on the store. Since we may want to add many objects to the store it is possible to do this initialization with multiple threads.

Next Chapter: Dirty Check