It is difficult to describe Java API usage without first examining 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 Transactions.
RunRecoveryException
Thrown whenever JE determines 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 reopen your environment.
Note that DatabaseException and its subclasses belong to the com.sleepycat.je package.