Top Description Fields Constructors Methods
org.eclipse.persistence.exceptions

public Class OptimisticLockException

extends EclipseLinkException
Class Inheritance
Imports
org.eclipse.persistence.queries.*, org.eclipse.persistence.exceptions.i18n.ExceptionMessageGenerator, org.eclipse.persistence.sessions.SessionProfiler, java.util.Vector

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.

Field Summary

Modifier and TypeField and Description
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
protected transient ObjectLevelModifyQuery
query

Store the query that raised the optimistic violation.

public static final int
public static final int
Inherited from org.eclipse.persistence.exceptions.EclipseLinkException:
CRerrorCodehasBeenLoggedindentationStringinternalExceptionsessionshouldPrintInternalException

Constructor Summary

AccessConstructor and Description
protected
OptimisticLockException()

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 TypeMethod and Description
public static OptimisticLockException
public Object
getObject()

PUBLIC: Return the object for which the problem was detected.

public ObjectLevelModifyQuery
getQuery()

PUBLIC: Return the query in which the problem was detected.

public static OptimisticLockException
public static OptimisticLockException
public static OptimisticLockException
public static OptimisticLockException
public static OptimisticLockException
public static OptimisticLockException
public static OptimisticLockException
public void
setQuery(ObjectLevelModifyQuery query)

INTERNAL: Set the query in which the problem was detected.

public static OptimisticLockException
Inherited from org.eclipse.persistence.exceptions.EclipseLinkException:
crgetErrorCodegetIndentationStringgetInternalExceptiongetMessagegetSessiongetUnformattedMessagehasBeenLoggedprintStackTraceprintStackTraceprintStackTracesetErrorCodesetHasBeenLoggedsetIndentationStringsetInternalExceptionsetSessionsetShouldPrintInternalExceptionshouldPrintInternalExceptiontoString

Field Detail

MUST_HAVE_MAPPING_WHEN_IN_OBJECTback to summary
public static final int MUST_HAVE_MAPPING_WHEN_IN_OBJECT
NEED_TO_MAP_JAVA_SQL_TIMESTAMPback to summary
public static final int NEED_TO_MAP_JAVA_SQL_TIMESTAMP
NO_VERSION_NUMBER_WHEN_DELETINGback to summary
public static final int NO_VERSION_NUMBER_WHEN_DELETING
NO_VERSION_NUMBER_WHEN_UPDATINGback to summary
public static final int NO_VERSION_NUMBER_WHEN_UPDATING
OBJECT_CHANGED_SINCE_LAST_MERGEback to summary
public static final int OBJECT_CHANGED_SINCE_LAST_MERGE
OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETINGback to summary
public static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETING
OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATINGback to summary
public static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING
queryback to summary
protected transient ObjectLevelModifyQuery query

Store the query that raised the optimistic violation.

STATEMENT_NOT_EXECUTED_IN_BATCHback to summary
public static final int STATEMENT_NOT_EXECUTED_IN_BATCH
UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READback to summary
public static final int UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READ

Constructor Detail

OptimisticLockExceptionback to summary
protected OptimisticLockException()

INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.

OptimisticLockExceptionback to summary
protected OptimisticLockException(String theMessage)

INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.

OptimisticLockExceptionback to summary
protected OptimisticLockException(String theMessage, ObjectLevelModifyQuery query)

INTERNAL: EclipseLink exceptions should only be thrown by EclipseLink.

Method Detail

batchStatementExecutionFailureback to summary
public static OptimisticLockException batchStatementExecutionFailure()
getObjectback to summary
public Object getObject()

PUBLIC: Return the object for which the problem was detected.

getQueryback to summary
public ObjectLevelModifyQuery getQuery()

PUBLIC: Return the query in which the problem was detected.

mustHaveMappingWhenStoredInObjectback to summary
public static OptimisticLockException mustHaveMappingWhenStoredInObject(Class<?> aClass)
needToMapJavaSqlTimestampWhenStoredInObjectback to summary
public static OptimisticLockException needToMapJavaSqlTimestampWhenStoredInObject()
noVersionNumberWhenDeletingback to summary
public static OptimisticLockException noVersionNumberWhenDeleting(Object object, ObjectLevelModifyQuery query)
noVersionNumberWhenUpdatingback to summary
public static OptimisticLockException noVersionNumberWhenUpdating(Object object, ObjectLevelModifyQuery query)
objectChangedSinceLastMergeback to summary
public static OptimisticLockException objectChangedSinceLastMerge(Object object)
objectChangedSinceLastReadWhenDeletingback to summary
public static OptimisticLockException objectChangedSinceLastReadWhenDeleting(Object object, ObjectLevelModifyQuery query)
objectChangedSinceLastReadWhenUpdatingback to summary
public static OptimisticLockException objectChangedSinceLastReadWhenUpdating(Object object, ObjectLevelModifyQuery query)
setQueryback to summary
public void setQuery(ObjectLevelModifyQuery query)

INTERNAL: Set the query in which the problem was detected.

unwrappingObjectDeletedSinceLastReadback to summary
public static OptimisticLockException unwrappingObjectDeletedSinceLastRead(Vector<E> pkVector, String className)