Berkeley DB Java Edition
version 5.0.34

com.sleepycat.je
Class EnvironmentFailureException

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.RunRecoveryException
                      extended by com.sleepycat.je.EnvironmentFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EnvironmentLockedException, EnvironmentNotFoundException, GroupShutdownException, LogWriteException, RestartRequiredException, ThreadInterruptedException, VersionMismatchException

public class EnvironmentFailureException
extends RunRecoveryException

Indicates that a failure has occurred that could impact the Environment as a whole. For failures that impact only the current operation and/or transaction, see OperationFailureException). For an overview of all exceptions thrown by JE, see DatabaseException.

Depending on the nature of the failure, this exception may indicate that Environment.close() must be called. The application should catch EnvironmentFailureException and then call Environment.isValid(). If false is returned, all Environment handles (instances) must be closed and re-opened in order to run recovery and continue operating. If true is returned, the Environment can continue operating without being closed and re-opened. Also note that Environment.isValid() may be called at any time, not just during exception handling.

The use of the Environment.isValid() method allows JE to determine dynamically whether the failure requires recovery or not, and allows for this determination to change in future releases. Over time, internal improvements to error handling may allow more error conditions to be handled without invalidating the Environment.

(Although this exception class extends RunRecoveryException, it does not always indicate that recovery is necessary, as described above. RunRecoveryException has been deprecated and EnvironmentFailureException should be used instead.)

If an EnvironmentFailureException consistently occurs soon after opening the Environment, this may indicate a persistent problem. It may indicate a system problem or a persistent storage problem. In this case, human intervention is normally required and restoring from a backup may be necessary.

Note that subclasses of EnvironmentFailureException indicate how to handle the exception in more specific ways.

If Environment.close() is not called after an EnvironmentFailureException invalidates the Environment, all subsequent method calls for the Environment will throw the same exception. This provides more than one opportunity to catch and handle the specific exception subclass that caused the failure.

See Also:
Serialized Form

Method Summary
 String getMessage()
           
 
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
 

Method Detail

getMessage

public String getMessage()
Overrides:
getMessage in class DatabaseException

Berkeley DB Java Edition
version 5.0.34

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