com.sleepycat.je
Class ForeignConstraintException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.sleepycat.je.DatabaseException
                  extended by com.sleepycat.je.OperationFailureException
                      extended by com.sleepycat.je.SecondaryReferenceException
                          extended by com.sleepycat.je.SecondaryConstraintException
                              extended by com.sleepycat.je.ForeignConstraintException
All Implemented Interfaces:
Serializable

public class ForeignConstraintException
extends SecondaryConstraintException

Thrown when an attempt to write a primary database record would insert a secondary record with a key that does not exist in a foreign key database, when the secondary key is configured as a foreign key.

When using the base API (com.sleepycat.je), this can occur when a SecondaryDatabase is configured to be associated with a foreign key database (see SecondaryConfig.setForeignKeyDatabase(com.sleepycat.je.Database)).

When using the DPL (com.sleepycat.persist), this can occur when a SecondaryKey is defined with a SecondaryKey.relatedEntity().

The Transaction handle is invalidated as a result of this exception.

Since:
4.0
See Also:
Special considerations for using Secondary Databases with and without Transactions, Serialized Form

Constructor Summary
ForeignConstraintException(Locker locker, String message, String secDbName, DatabaseEntry secKey, DatabaseEntry priKey)
          For internal use only.
 
Method Summary
 OperationFailureException wrapSelf(String msg)
          For internal use only.
 
Methods inherited from class com.sleepycat.je.SecondaryReferenceException
getPrimaryKey, getSecondaryDatabaseName, getSecondaryKey
 
Methods inherited from class com.sleepycat.je.DatabaseException
addErrorMessage, getMessage, getVersionHeader
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

ForeignConstraintException

public ForeignConstraintException(Locker locker,
                                  String message,
                                  String secDbName,
                                  DatabaseEntry secKey,
                                  DatabaseEntry priKey)
For internal use only.

Method Detail

wrapSelf

public OperationFailureException wrapSelf(String msg)
For internal use only.

Specified by:
wrapSelf in class OperationFailureException


Copyright (c) 2004-2010 Oracle. All rights reserved.