##### General information

- Overview
- News and Status
- Downloads
- Addons
- Changes
- Old Changes
- Wiki
- Issue tracker
- Mailing lists
- Tools
- License
- Team
- Developer Information
- Sponsorship
- Security
- Thanks

##### Documentation

- Tutorial
- OR Mapping Reference
  - Defining the Schema
  - Running the Generator
  - Database independence
  - Initialisation of the Runtime
  - Reading from the DB
  - Writing to the DB
  - Extending classes
  - Connections and Transactions
  - Exception handling
  - Inheritance
  - Supported databases
  - Supporting a new DB
  - Managers and Cache
  - Beans
  - Avalon Component
  - Customizing the generation
  - Relevant classes
  - Source XSD
  - Source XSD (strict)
  - Migration from Torque 3
- Code Generation Reference
- Module Documentation

##### Previous releases

- Torque 3.3

## Exception handling

Torque converts all Exceptions thrown by the Database into instances of `org.apache.torque.TorqueException` or subclasses thereof. TorqueException is a checked exception.

Subclasses of TorqueException whcih are generated by database exceptions are:

- `org.apache.torque.ConstraintViolationException` - thrown whenever a write operation violates a unique key, a not-null constraint or a foreign key constraint in the database.
- `org.apache.torque.DeadlockEception` - thrown whenever the database detects a deadlock between two or more transaction which are executed simultaneously (Note: hsqldb does not seem to be able to detect deadlocks as of version 2.2.8).

All other database exceptions are mapped to TorqueException directly.

Torque also can throw TorqueExceptions or subclasses thereof without a database error, e.g. if a database is accessed via Torque when Torque is not initialized. Subclasses of TorqueExceptions thrown in special situations are:

- `org.apache.torque.NoRowsException` - thrown whenever a read operation expects to hit exactly one record but does not hit one (e.g. the generated retrieveByPk methods in the generated peer classes).
- `org.apache.torque.TooManyRowsException` - thrown whenever a read operation expects to hit at most one record but does hit more than one (e.g. by the doSelectSingleRecord methods in the peer classes).