JE Exceptions
Prev | Chapter 1. Introduction to Berkeley DB Java Edition | Next

## JE Exceptions

Before describing the Java API usage, it is first useful to examine the exceptions thrown by those APIs. So, briefly, this section describes the exceptions that you can expect to encounter when writing JE applications.

All of the JE APIs throw `DatabaseException`. `DatabaseException` extends `java.lang.Exception`. Also, the following classes are subclasses of `DatabaseException`:

- `DatabaseNotFoundException`

  Thrown whenever an operation requires a database, and that database cannot be found.

- `DeadlockException`

  Thrown whenever a transaction is selected to resolve a deadlock. Upon receiving this exception, any open cursors must be closed and the enclosing transaction aborted. Transactions are described in the JE Transactional Processing Guide.

- `RunRecoveryException`

  Thrown whenever JE experiences a catastrophic error such that recovery needs to be run on the database. If you receive this exception, you must reopen your environment so as to allow normal recovery to run. See Databases and Log Files for more information on how normal recovery works.

  Note that when reopening your environment, you should stop all database read and write activities, close all your cursors, close all your databases, and then close and reopen your environment.

Note that `DatabaseException` and its subclasses belong to the `com.sleepycat.je` package.

Prev | Up | Next
Getting and Using JE | Home | Six Things Everyone Should Know about JE Log Files