Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.exceptions
Class OptimisticLockException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byoracle.toplink.exceptions.TopLinkException
                  extended byoracle.toplink.exceptions.OptimisticLockException

All Implemented Interfaces:
java.io.Serializable

public class OptimisticLockException
extends TopLinkException

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_READ_WHEN_DELETING
static int OBJECT_CHANGED_SINCE_LAST_READ_WHEN_UPDATING

Method Summary
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 objectChangedSinceLastReadWhenDeleting(java.lang.Object object, ObjectLevelModifyQuery query)
static OptimisticLockException objectChangedSinceLastReadWhenUpdating(java.lang.Object object, ObjectLevelModifyQuery query)

Methods inherited from class oracle.toplink.exceptions.TopLinkException
getErrorCode, getInternalException, getMessage, getSession, printStackTrace, printStackTrace, printStackTrace, setShouldPrintInternalException

Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

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

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.

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)

needToMapJavaSqlTimestampWhenStoredInObject

public static OptimisticLockException needToMapJavaSqlTimestampWhenStoredInObject()

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.