com.amazon.carbonado
Class OptimisticLockException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.amazon.carbonado.RepositoryException
              extended by com.amazon.carbonado.PersistException
                  extended by com.amazon.carbonado.OptimisticLockException
All Implemented Interfaces:
Serializable

public class OptimisticLockException
extends PersistException

An OptimisticLockException is thrown if the Repository is using optimistic locking for concurrency control, and lock aquisition failed. This exception may also be thrown if multiversion concurrency control (MVCC) is being used and the commit fails.

Author:
Brian S O'Neill
See Also:
Serialized Form

Constructor Summary
OptimisticLockException()
           
OptimisticLockException(long expectedVersion)
           
OptimisticLockException(Object expectedVersion)
           
OptimisticLockException(Object expectedVersion, Object savedVersion)
           
OptimisticLockException(Object expectedVersion, Object savedVersion, Storable s)
           
OptimisticLockException(Object savedVersion, Storable s, Object newVersion)
          Construct exception for when new version was expected to have increased.
OptimisticLockException(String message)
           
OptimisticLockException(String message, Throwable cause)
           
OptimisticLockException(Throwable cause)
           
 
Method Summary
 Storable getStorable()
          Returns the Storable which was acted upon, or null if not available.
 
Methods inherited from class com.amazon.carbonado.RepositoryException
backoff, getRootCause, makeFetchException, makePersistException, toFetchException, toFetchException, toPersistException, toPersistException
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptimisticLockException

public OptimisticLockException()

OptimisticLockException

public OptimisticLockException(String message)

OptimisticLockException

public OptimisticLockException(String message,
                               Throwable cause)

OptimisticLockException

public OptimisticLockException(Throwable cause)

OptimisticLockException

public OptimisticLockException(long expectedVersion)
Parameters:
expectedVersion - version number that was expected for persistent record when update was executed

OptimisticLockException

public OptimisticLockException(Object expectedVersion)
Parameters:
expectedVersion - version number that was expected for persistent record when update was executed

OptimisticLockException

public OptimisticLockException(Object expectedVersion,
                               Object savedVersion)
Parameters:
expectedVersion - version number that was expected for persistent record when update was executed
savedVersion - actual persistent version number of storable

OptimisticLockException

public OptimisticLockException(Object expectedVersion,
                               Object savedVersion,
                               Storable s)
Parameters:
expectedVersion - version number that was expected for persistent record when update was executed
savedVersion - actual persistent version number of storable
s - Storable which was acted upon

OptimisticLockException

public OptimisticLockException(Object savedVersion,
                               Storable s,
                               Object newVersion)
Construct exception for when new version was expected to have increased.

Parameters:
savedVersion - actual persistent version number of storable
s - Storable which was acted upon
newVersion - new version which was provided
Since:
1.2
Method Detail

getStorable

public Storable getStorable()
Returns the Storable which was acted upon, or null if not available.



Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.