Class OptimisticLockException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.eclipse.persistence.exceptions.EclipseLinkException
org.eclipse.persistence.exceptions.OptimisticLockException
- All Implemented Interfaces:
- Serializable
Purpose: This exception is used when TopLink's optimistic locking feature is used. It will be raised if the object being updated or deleted was changed or deleted from the database since it as last read.
- See Also:
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprotected ObjectLevelModifyQueryStore the query that raised the optimistic violation.static final intstatic final intFields inherited from class org.eclipse.persistence.exceptions.EclipseLinkExceptionCR, errorCode, hasBeenLogged, indentationString, internalException, session, shouldPrintInternalException
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedINTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.protectedOptimisticLockException(String theMessage) INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.protectedOptimisticLockException(String theMessage, ObjectLevelModifyQuery query) INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.
- 
Method SummaryModifier and TypeMethodDescriptionstatic OptimisticLockExceptionPUBLIC: Return the object for which the problem was detected.getQuery()PUBLIC: Return the query in which the problem was detected.static OptimisticLockExceptionstatic OptimisticLockExceptionstatic OptimisticLockExceptionnoVersionNumberWhenDeleting(Object object, ObjectLevelModifyQuery query) static OptimisticLockExceptionnoVersionNumberWhenUpdating(Object object, ObjectLevelModifyQuery query) static OptimisticLockExceptionobjectChangedSinceLastMerge(Object object) static OptimisticLockExceptionobjectChangedSinceLastReadWhenDeleting(Object object, ObjectLevelModifyQuery query) static OptimisticLockExceptionobjectChangedSinceLastReadWhenUpdating(Object object, ObjectLevelModifyQuery query) voidsetQuery(ObjectLevelModifyQuery query) INTERNAL: Set the query in which the problem was detected.static OptimisticLockExceptionunwrappingObjectDeletedSinceLastRead(Vector pkVector, String className) Methods inherited from class org.eclipse.persistence.exceptions.EclipseLinkExceptioncr, getErrorCode, getIndentationString, getInternalException, getMessage, getSession, getUnformattedMessage, hasBeenLogged, printStackTrace, printStackTrace, printStackTrace, setErrorCode, setHasBeenLogged, setIndentationString, setInternalException, setSession, setShouldPrintInternalException, shouldPrintInternalException, toStringMethods inherited from class java.lang.ThrowableaddSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace
- 
Field Details- 
queryStore the query that raised the optimistic violation.
- 
NO_VERSION_NUMBER_WHEN_DELETINGpublic static final int NO_VERSION_NUMBER_WHEN_DELETING- See Also:
 
- 
OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETINGpublic static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETING- See Also:
 
- 
NO_VERSION_NUMBER_WHEN_UPDATINGpublic static final int NO_VERSION_NUMBER_WHEN_UPDATING- See Also:
 
- 
OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATINGpublic static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING- See Also:
 
- 
MUST_HAVE_MAPPING_WHEN_IN_OBJECTpublic static final int MUST_HAVE_MAPPING_WHEN_IN_OBJECT- See Also:
 
- 
NEED_TO_MAP_JAVA_SQL_TIMESTAMPpublic static final int NEED_TO_MAP_JAVA_SQL_TIMESTAMP- See Also:
 
- 
UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READpublic static final int UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READ- See Also:
 
- 
OBJECT_CHANGED_SINCE_LAST_MERGEpublic static final int OBJECT_CHANGED_SINCE_LAST_MERGE- See Also:
 
- 
STATEMENT_NOT_EXECUTED_IN_BATCHpublic static final int STATEMENT_NOT_EXECUTED_IN_BATCH- See Also:
 
 
- 
- 
Constructor Details- 
OptimisticLockExceptionprotected OptimisticLockException()INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.
- 
OptimisticLockExceptionINTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.
- 
OptimisticLockExceptionINTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.
 
- 
- 
Method Details- 
getObjectPUBLIC: Return the object for which the problem was detected.
- 
getQueryPUBLIC: Return the query in which the problem was detected.
- 
batchStatementExecutionFailure
- 
mustHaveMappingWhenStoredInObject
- 
noVersionNumberWhenDeletingpublic static OptimisticLockException noVersionNumberWhenDeleting(Object object, ObjectLevelModifyQuery query) 
- 
noVersionNumberWhenUpdatingpublic static OptimisticLockException noVersionNumberWhenUpdating(Object object, ObjectLevelModifyQuery query) 
- 
objectChangedSinceLastReadWhenDeletingpublic static OptimisticLockException objectChangedSinceLastReadWhenDeleting(Object object, ObjectLevelModifyQuery query) 
- 
objectChangedSinceLastReadWhenUpdatingpublic static OptimisticLockException objectChangedSinceLastReadWhenUpdating(Object object, ObjectLevelModifyQuery query) 
- 
objectChangedSinceLastMerge
- 
unwrappingObjectDeletedSinceLastReadpublic static OptimisticLockException unwrappingObjectDeletedSinceLastRead(Vector pkVector, String className) 
- 
needToMapJavaSqlTimestampWhenStoredInObject
- 
setQueryINTERNAL: Set the query in which the problem was detected.
 
-