javax.persistence
Class PessimisticLockException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.persistence.PersistenceException
                  extended by javax.persistence.PessimisticLockException
All Implemented Interfaces:
Serializable

public class PessimisticLockException
extends PersistenceException

Thrown by the persistence provider when an pessimistic locking conflict occurs. This exception may be thrown as part of an API call, a flush or at commit time. The current transaction, if one is active, will be marked for rollback.

Since:
JPA 2.0 version.
Author:
Florent Benoit
See Also:
JPA 2.0 specification, Serialized Form

Constructor Summary
PessimisticLockException()
          Default constructor : builds an exception with an empty message.
PessimisticLockException(Object entity)
          Build an exception with the given entity object.
PessimisticLockException(String message)
          Build an exception with the given message.
PessimisticLockException(String message, Throwable causedByThrowable)
          Builds an exception with a given message and given exception.
PessimisticLockException(String message, Throwable causedByThrowable, Object entity)
          Builds an exception with a given message and given exception.
PessimisticLockException(Throwable causedByThrowable)
          Build an exception with the given exception.
 
Method Summary
 Object getEntity()
          Returns the entity that caused this exception.
 
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

PessimisticLockException

public PessimisticLockException()
Default constructor : builds an exception with an empty message.


PessimisticLockException

public PessimisticLockException(Object entity)
Build an exception with the given entity object.

Parameters:
entity - the given entity to use.

PessimisticLockException

public PessimisticLockException(String message)
Build an exception with the given message.

Parameters:
message - the given message to use.

PessimisticLockException

public PessimisticLockException(Throwable causedByThrowable)
Build an exception with the given exception.

Parameters:
causedByThrowable - the cause of this exception.

PessimisticLockException

public PessimisticLockException(String message,
                                Throwable causedByThrowable)
Builds an exception with a given message and given exception.

Parameters:
message - the message of this exception.
causedByThrowable - the cause of this exception.

PessimisticLockException

public PessimisticLockException(String message,
                                Throwable causedByThrowable,
                                Object entity)
Builds an exception with a given message and given exception.

Parameters:
message - the message of this exception.
causedByThrowable - the cause of this exception.
Method Detail

getEntity

public Object getEntity()
Returns the entity that caused this exception.

Returns:
the entity.


Copyright © 2007-2012 OW2 Consortium. All Rights Reserved.