IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

com.ibm.websphere.objectgrid.plugins
Interface RetryableLoader

All Superinterfaces:
Loader
All Known Implementing Classes:
JPAEntityLoader, JPALoader

public interface RetryableLoader
extends Loader

This interface represents a loader which is capable of handling a retry (redo) update from ObjectGrid runtime.

A retryable loader takes a retry hint from the ObjectGrid runtime to know whether the LogSequence passed to the Loader.batchUpdate(com.ibm.websphere.objectgrid.TxID, LogSequence) method is a retry sequence or not. The retryable loader checks the retry indication Boolean by calling TxID.getSlot(int) method. If the slot contains a Boolean.TRUE object, then the log sequence is a retry sequence. If the slot contains a null object or a Boolean.FALSE, then the log sequence is not a retry sequence. The slot number is set by ObjectGrid runtime using setRetryIndicationSlot(int) method.

In some extreme cases, mainly during the failover, ObjectGrid could send the same log sequence twice to the database to avoid data loss. This requires the loader to be idempotent, which means whenever the Loader.batchUpdate(com.ibm.websphere.objectgrid.TxID, LogSequence) method is called twice with the same value, it gives the same result as if it were applied once.

A retryable loader is more than idempotent. ObjectGrid could send a different log sequence to the database and requires the Loader treat it as a retry. In that case, the Loader has to consult the database and take appropriate behaviors. Here are a few guidelines:

  1. For an insert type log element, if the database already has that record, treat it as an update.
  2. For an update type log element, if the database does not have that record, treat it as an insert.
  3. For a delete type log element, if the database does not have that record, treat it as no-op.
Currently, the retry function is only enabled if the map is configured with write-behind enabled to ensure no data will be lost. This will only work with synchronous replica. If the replica is asynchronous, there could still be data loss.

Since:
WAS XD 6.1.0.3
See Also:
WriteBehindLoaderConstants

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.ibm.websphere.objectgrid.plugins.Loader
Loader.SpecialValue
 
Field Summary
 
Fields inherited from interface com.ibm.websphere.objectgrid.plugins.Loader
KEY_NOT_FOUND
 
Method Summary
 void setRetryIndicationSlot(int slotNumber)
          set the slot number which contains whether the batch update from ObjectGrid is a retry of previous transaction.
 
Methods inherited from interface com.ibm.websphere.objectgrid.plugins.Loader
batchUpdate, get, preloadMap
 

Method Detail

setRetryIndicationSlot

void setRetryIndicationSlot(int slotNumber)
set the slot number which contains whether the batch update from ObjectGrid is a retry of previous transaction. The retryable loader checks the retry indication Boolean by calling TxID.getSlot(int) method. If the slot contains a Boolean.TRUE object, then the log sequence is a retry sequence. If the slot contains a null object or a Boolean.FALSE, then the log sequence is not a retry sequence.

Parameters:
slotNumber - the slot number

IBM WebSphereTM eXtreme Scale, Release 8.6
API Specification

© Copyright International Business Machines Corp 2005,2012. All rights reserved.