|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception com.ibm.websphere.objectgrid.ObjectGridException com.ibm.websphere.objectgrid.plugins.OptimisticCollisionException
public class OptimisticCollisionException
This exception is thrown when optimistic locking strategy is used and more than one update transaction collides on the same map entry of a ObjectGrid instance. The first transaction to commit updates the version object for the map entry. Other transactions that read this same map entry prior to the commit have the prior version object. When the other transactions try to commit, the version object it read will not match the version that was last committed. Thus the other transactions are prevented from updating a map entry using "stale" data.
The default OptimisticCallback used by the runtime if one is not provided by the application will cause this exception to be thrown if there is not a well constructed equals(Object) method on your value object since the entire value object is used as the version object.
Since this exception indicates the map entry contains stale data, ObjectGrid
will invalidate the stale map entry or entries as identified by the key parameter that
is passed to the OptimisticCollisionException(String, String, String, Object)
method. If this exception is thrown by a Loader
plugin and a
null
reference is used as the key parameter by the
loader, ObjectGrid assumes the loader does not know which entry caused the
exception. In this case, ObjectGrid will use the LogSequence
that was passed to the Loader.batchUpdate(TxID, LogSequence)
method to determine which map entries to invalidate. Each LogElement
in the LogSequence
of type update or delete will be invalidated.
NoVersioningOptimisticCallback
,
OptimisticCallback
,
BackingMap.setOptimisticCallback(OptimisticCallback)
,
Loader.batchUpdate(TxID, LogSequence)
,
LogElement.DELETE
,
LogElement.UPDATE
,
Serialized FormConstructor Summary | |
---|---|
OptimisticCollisionException(String message,
String gridName,
String mapName,
Object key)
Constructs a new OptimisticCollisionException with the specified detail message and key of a map of an ObjectGrid. |
Method Summary | |
---|---|
String |
getGridName()
Gets the name of the ObjectGrid instance the optimistic collision occurred in. |
Object |
getKey()
Gets the key(s) that caused this exception to occur. |
String |
getMapName()
Gets the map name the optimistic collision occurred in. |
Methods inherited from class com.ibm.websphere.objectgrid.ObjectGridException |
---|
getCause, initCause |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OptimisticCollisionException(String message, String gridName, String mapName, Object key)
initCause
method.
message
- the detail message. The detail message is saved for later
retrieval by the getMessage
method.gridName
- the name of the grid the map belongs to.mapName
- the name of the map.key
- the key or array of keys that caused the optimistic collision
exception to occur. If more than a single key caused the
exception, then an array of object should be used for this
parameter. Each array element in this case identifies a
single map entry that caused the exception to occur. This is
useful when a Loader uses the batch update support of a JDBC driver.
A null reference should be passed if unable to determine which key
or set of keys caused this exception to occur.getGridName()
,
getKey()
,
getMapName()
,
Throwable.getMessage()
,
ObjectGridException.initCause(Throwable)
Method Detail |
---|
public final String getGridName()
public final String getMapName()
public final Object getKey()
|
IBM WebSphereTM eXtreme Scale, Release 8.6 API Specification |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |