Module org.eclipse.persistence.core
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 Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
protected ObjectLevelModifyQuery
Store the query that raised the optimistic violation.static final int
static final int
Fields inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
CR, errorCode, hasBeenLogged, indentationString, internalException, session, shouldPrintInternalException
-
Constructor Summary
ModifierConstructorDescriptionprotected
INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.protected
OptimisticLockException
(String theMessage) INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.protected
OptimisticLockException
(String theMessage, ObjectLevelModifyQuery query) INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink. -
Method Summary
Modifier and TypeMethodDescriptionstatic OptimisticLockException
PUBLIC: Return the object for which the problem was detected.getQuery()
PUBLIC: Return the query in which the problem was detected.static OptimisticLockException
mustHaveMappingWhenStoredInObject
(Class<?> aClass) static OptimisticLockException
static OptimisticLockException
noVersionNumberWhenDeleting
(Object object, ObjectLevelModifyQuery query) static OptimisticLockException
noVersionNumberWhenUpdating
(Object object, ObjectLevelModifyQuery query) static OptimisticLockException
objectChangedSinceLastMerge
(Object object) static OptimisticLockException
objectChangedSinceLastReadWhenDeleting
(Object object, ObjectLevelModifyQuery query) static OptimisticLockException
objectChangedSinceLastReadWhenUpdating
(Object object, ObjectLevelModifyQuery query) void
setQuery
(ObjectLevelModifyQuery query) INTERNAL: Set the query in which the problem was detected.static OptimisticLockException
unwrappingObjectDeletedSinceLastRead
(Vector pkVector, String className) Methods inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
cr, getErrorCode, getIndentationString, getInternalException, getMessage, getSession, getUnformattedMessage, hasBeenLogged, printStackTrace, printStackTrace, printStackTrace, setErrorCode, setHasBeenLogged, setIndentationString, setInternalException, setSession, setShouldPrintInternalException, shouldPrintInternalException, toString
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, setStackTrace
-
Field Details
-
query
Store the query that raised the optimistic violation. -
NO_VERSION_NUMBER_WHEN_DELETING
public static final int NO_VERSION_NUMBER_WHEN_DELETING- See Also:
-
OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETING
public static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETING- See Also:
-
NO_VERSION_NUMBER_WHEN_UPDATING
public static final int NO_VERSION_NUMBER_WHEN_UPDATING- See Also:
-
OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING
public static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING- See Also:
-
MUST_HAVE_MAPPING_WHEN_IN_OBJECT
public static final int MUST_HAVE_MAPPING_WHEN_IN_OBJECT- See Also:
-
NEED_TO_MAP_JAVA_SQL_TIMESTAMP
public static final int NEED_TO_MAP_JAVA_SQL_TIMESTAMP- See Also:
-
UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READ
public static final int UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READ- See Also:
-
OBJECT_CHANGED_SINCE_LAST_MERGE
public static final int OBJECT_CHANGED_SINCE_LAST_MERGE- See Also:
-
STATEMENT_NOT_EXECUTED_IN_BATCH
public static final int STATEMENT_NOT_EXECUTED_IN_BATCH- See Also:
-
-
Constructor Details
-
OptimisticLockException
protected OptimisticLockException()INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink. -
OptimisticLockException
INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink. -
OptimisticLockException
INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.
-
-
Method Details
-
getObject
PUBLIC: Return the object for which the problem was detected. -
getQuery
PUBLIC: Return the query in which the problem was detected. -
batchStatementExecutionFailure
-
mustHaveMappingWhenStoredInObject
-
noVersionNumberWhenDeleting
public static OptimisticLockException noVersionNumberWhenDeleting(Object object, ObjectLevelModifyQuery query) -
noVersionNumberWhenUpdating
public static OptimisticLockException noVersionNumberWhenUpdating(Object object, ObjectLevelModifyQuery query) -
objectChangedSinceLastReadWhenDeleting
public static OptimisticLockException objectChangedSinceLastReadWhenDeleting(Object object, ObjectLevelModifyQuery query) -
objectChangedSinceLastReadWhenUpdating
public static OptimisticLockException objectChangedSinceLastReadWhenUpdating(Object object, ObjectLevelModifyQuery query) -
objectChangedSinceLastMerge
-
unwrappingObjectDeletedSinceLastRead
public static OptimisticLockException unwrappingObjectDeletedSinceLastRead(Vector pkVector, String className) -
needToMapJavaSqlTimestampWhenStoredInObject
-
setQuery
INTERNAL: Set the query in which the problem was detected.
-