Oracle® Application Server TopLink Application Developer's Guide
10g Release 2 (10.1.2) Part No. B15901-01 |
|
Previous |
Next |
Most exceptions in queries are database exceptions, resulting from a failure in the database operation. Write operations can also throw an OptimisticLockException
on a write, update, or delete operation in applications that use optimistic locking. To catch these exceptions, execute all database operations within a try-catch block.
{
try {
Vector employees = session.readAllObjects(Employee.class);
}
catch (DatabaseException exception) {
// Handle exception
}
}
For more information about exceptions in a OracleAS TopLink application, see Appendix C, "Troubleshooting".