FileDocCategorySizeDatePackage
OptimisticLockException.javaAPI DocGlassfish v2 API4284Fri May 04 22:34:06 BST 2007javax.persistence

OptimisticLockException

public class OptimisticLockException extends PersistenceException
Thrown by the persistence provider when an optimistic 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
Java Persistence 1.0

Fields Summary
Object
entity
The object that caused the exception
Constructors Summary
public OptimisticLockException()
Constructs a new OptimisticLockException exception with null as its detail message.

        super();
    
public OptimisticLockException(String message)
Constructs a new OptimisticLockException exception with the specified detail message.

param
message the detail message.

        super(message);
    
public OptimisticLockException(String message, Throwable cause)
Constructs a new OptimisticLockException exception with the specified detail message and cause.

param
message the detail message.
param
cause the cause.

        super(message, cause);
    
public OptimisticLockException(Throwable cause)
Constructs a new OptimisticLockException exception with the specified cause.

param
cause the cause.

        super(cause);
    
public OptimisticLockException(Object entity)
Constructs a new OptimisticLockException exception with the specified entity.

param
entity the entity.

        this.entity = entity;
    
public OptimisticLockException(String message, Throwable cause, Object entity)
Constructs a new OptimisticLockException exception with the specified detail message, cause, and entity.

param
message the detail message.
param
cause the cause.
param
entity the entity.

        super(message, cause);
        this.entity = entity;
    
Methods Summary
public java.lang.ObjectgetEntity()
Returns the entity that caused this exception.

return
the entity.

        return this.entity;