SecondaryReferenceException (Oracle - Berkeley DB Java Edition API)
Date: 2014-12-16

com.sleepycat.je

## Class SecondaryReferenceException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - com.sleepycat.je.DatabaseException
        - - com.sleepycat.je.OperationFailureException
          - - com.sleepycat.je.SecondaryReferenceException

- All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    SecondaryConstraintException, SecondaryIntegrityException

      public abstract class SecondaryReferenceException
      extends OperationFailureException

  Base class for exceptions thrown when a read or write operation fails because of a secondary constraint or integrity problem. Provides accessors for getting further information about the database and keys involved in the failure. See subclasses for more information.

  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

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `DatabaseEntry` | `getPrimaryKey()` Returns the primary key being access during the failure.
    `String` | `getSecondaryDatabaseName()` Returns the name of the secondary database being access during the failure.
    `DatabaseEntry` | `getSecondaryKey()` Returns the secondary key being access during the failure.

    - ### Methods inherited from class com.sleepycat.je.DatabaseException

      `getMessage`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getSecondaryDatabaseName

          public String getSecondaryDatabaseName()

      Returns the name of the secondary database being access during the failure.

    - #### getSecondaryKey

          public DatabaseEntry getSecondaryKey()

      Returns the secondary key being access during the failure.

    - #### getPrimaryKey

          public DatabaseEntry getPrimaryKey()

      Returns the primary key being access during the failure.

Copyright (c) 2004, 2014 Oracle and/or its affiliates. All rights reserved.