EclipseLink 1.2.0, build 'v20091016-r5565' API Reference

org.eclipse.persistence.exceptions
Class OptimisticLockException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.eclipse.persistence.exceptions.EclipseLinkException
                  extended by org.eclipse.persistence.exceptions.OptimisticLockException
All Implemented Interfaces:
java.io.Serializable

public class OptimisticLockException
extends EclipseLinkException

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:
Serialized Form

Field Summary
static int MUST_HAVE_MAPPING_WHEN_IN_OBJECT
           
static int NEED_TO_MAP_JAVA_SQL_TIMESTAMP
           
static int NO_VERSION_NUMBER_WHEN_DELETING
           
static int NO_VERSION_NUMBER_WHEN_UPDATING
           
static int OBJECT_CHANGED_SINCE_LAST_MERGE
           
static int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETING
           
static int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING
           
protected  ObjectLevelModifyQuery query
          Store the query that raised the optimistic violation.
static int STATEMENT_NOT_EXECUTED_IN_BATCH
           
static int UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READ
           
 
Fields inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
CR, errorCode, hasBeenLogged, indentationString, internalException, session, shouldPrintInternalException
 
Constructor Summary
protected OptimisticLockException(java.lang.String theMessage)
          INTERNAL: TopLink exceptions should only be thrown by TopLink.
protected OptimisticLockException(java.lang.String theMessage, ObjectLevelModifyQuery query)
          INTERNAL: TopLink exceptions should only be thrown by TopLink.
 
Method Summary
static OptimisticLockException batchStatementExecutionFailure()
           
 java.lang.Object getObject()
          PUBLIC: Return the object for which the problem was detected.
 ObjectLevelModifyQuery getQuery()
          PUBLIC: Return the query in which the problem was detected.
static OptimisticLockException mustHaveMappingWhenStoredInObject(java.lang.Class aClass)
           
static OptimisticLockException needToMapJavaSqlTimestampWhenStoredInObject()
           
static OptimisticLockException noVersionNumberWhenDeleting(java.lang.Object object, ObjectLevelModifyQuery query)
           
static OptimisticLockException noVersionNumberWhenUpdating(java.lang.Object object, ObjectLevelModifyQuery query)
           
static OptimisticLockException objectChangedSinceLastMerge(java.lang.Object object)
           
static OptimisticLockException objectChangedSinceLastReadWhenDeleting(java.lang.Object object, ObjectLevelModifyQuery query)
           
static OptimisticLockException objectChangedSinceLastReadWhenUpdating(java.lang.Object object, ObjectLevelModifyQuery query)
           
 void setQuery(ObjectLevelModifyQuery query)
          INTERNAL: Set the query in which the problem was detected.
static OptimisticLockException unwrappingObjectDeletedSinceLastRead(java.util.Vector pkVector, java.lang.String className)
           
 
Methods inherited from class org.eclipse.persistence.exceptions.EclipseLinkException
cr, getErrorCode, getIndentationString, getInternalException, getMessage, getSession, hasBeenLogged, printStackTrace, printStackTrace, printStackTrace, setErrorCode, setHasBeenLogged, setIndentationString, setInternalException, setSession, setShouldPrintInternalException, shouldPrintInternalException, toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

query

protected transient ObjectLevelModifyQuery 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:
Constant Field Values

OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETING

public static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_DELETING
See Also:
Constant Field Values

NO_VERSION_NUMBER_WHEN_UPDATING

public static final int NO_VERSION_NUMBER_WHEN_UPDATING
See Also:
Constant Field Values

OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING

public static final int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING
See Also:
Constant Field Values

MUST_HAVE_MAPPING_WHEN_IN_OBJECT

public static final int MUST_HAVE_MAPPING_WHEN_IN_OBJECT
See Also:
Constant Field Values

NEED_TO_MAP_JAVA_SQL_TIMESTAMP

public static final int NEED_TO_MAP_JAVA_SQL_TIMESTAMP
See Also:
Constant Field Values

UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READ

public static final int UNWRAPPING_OBJECT_DELETED_SINCE_LAST_READ
See Also:
Constant Field Values

OBJECT_CHANGED_SINCE_LAST_MERGE

public static final int OBJECT_CHANGED_SINCE_LAST_MERGE
See Also:
Constant Field Values

STATEMENT_NOT_EXECUTED_IN_BATCH

public static final int STATEMENT_NOT_EXECUTED_IN_BATCH
See Also:
Constant Field Values
Constructor Detail

OptimisticLockException

protected OptimisticLockException(java.lang.String theMessage)
INTERNAL: TopLink exceptions should only be thrown by TopLink.


OptimisticLockException

protected OptimisticLockException(java.lang.String theMessage,
                                  ObjectLevelModifyQuery query)
INTERNAL: TopLink exceptions should only be thrown by TopLink.

Method Detail

getObject

public java.lang.Object getObject()
PUBLIC: Return the object for which the problem was detected.


getQuery

public ObjectLevelModifyQuery getQuery()
PUBLIC: Return the query in which the problem was detected.


batchStatementExecutionFailure

public static OptimisticLockException batchStatementExecutionFailure()

mustHaveMappingWhenStoredInObject

public static OptimisticLockException mustHaveMappingWhenStoredInObject(java.lang.Class aClass)

noVersionNumberWhenDeleting

public static OptimisticLockException noVersionNumberWhenDeleting(java.lang.Object object,
                                                                  ObjectLevelModifyQuery query)

noVersionNumberWhenUpdating

public static OptimisticLockException noVersionNumberWhenUpdating(java.lang.Object object,
                                                                  ObjectLevelModifyQuery query)

objectChangedSinceLastReadWhenDeleting

public static OptimisticLockException objectChangedSinceLastReadWhenDeleting(java.lang.Object object,
                                                                             ObjectLevelModifyQuery query)

objectChangedSinceLastReadWhenUpdating

public static OptimisticLockException objectChangedSinceLastReadWhenUpdating(java.lang.Object object,
                                                                             ObjectLevelModifyQuery query)

objectChangedSinceLastMerge

public static OptimisticLockException objectChangedSinceLastMerge(java.lang.Object object)

unwrappingObjectDeletedSinceLastRead

public static OptimisticLockException unwrappingObjectDeletedSinceLastRead(java.util.Vector pkVector,
                                                                           java.lang.String className)

needToMapJavaSqlTimestampWhenStoredInObject

public static OptimisticLockException needToMapJavaSqlTimestampWhenStoredInObject()

setQuery

public void setQuery(ObjectLevelModifyQuery query)
INTERNAL: Set the query in which the problem was detected.


EclipseLink 1.2.0, build 'v20091016-r5565' API Reference