Class ConcurrentWriteDetector
java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.utils.ConcurrentWriteDetector
Recognizes the failure of a write that lost the race with another write: the backend reports
it with an
ONeedRetryException when both changed the same records, and with a
duplicate key (see DuplicateKeyDetector) when both wrote the same value of a unique
index (e.g. the same id), which the checks of the service, made before the other write
committed, could not see. The layers above may have wrapped it. Repeated, the write meets the
committed one and gets its ordinary answer.- Author:
- Luca Frosini (ISTI - CNR)
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisConcurrentWrite(Throwable throwable) Returns whether the given failure, or one of its causes, is a concurrent write lost.
-
Method Details
-
isConcurrentWrite
Returns whether the given failure, or one of its causes, is a concurrent write lost.- Parameters:
throwable- the failure- Returns:
trueif the write can be repeated as it is
-