Лекции.Орг


Поиск:




Категории:

Астрономия
Биология
География
Другие языки
Интернет
Информатика
История
Культура
Литература
Логика
Математика
Медицина
Механика
Охрана труда
Педагогика
Политика
Право
Психология
Религия
Риторика
Социология
Спорт
Строительство
Технология
Транспорт
Физика
Философия
Финансы
Химия
Экология
Экономика
Электроника

 

 

 

 


Figure 6-1. Exception-handling architecture




Adopting an Exception-Handling Strategy

PL/SQL exception handling is very powerful and flexible, but it can also be confusing and tricky. It is extremely important to establish a consistent strategy and architecture for error handling in your application before you write any code. To do that, you must answer questions like these:

· How and when do I log errors so that they can be reviewed and corrected?

· How and when do I report the occurrence of errors back to the user?

Linked tightly to these very high-level questions are more concrete issues, such as:

· Should I include an exception-handling section in every one of my PL/SQL blocks?

· Should I have an exception-handling section only in the top-level or outermost blocks?

· How should I manage my transactions when errors occur?

Part of the complexity of exception handling is that there is no single right answer to any of these questions. It depends at least in part on the application architecture and the way it is used (batch process versus user-driven transactions, for example). However you answer these questions for your application, I strongly suggest that you "codify" the strategy and rules for error handling within a standardized package. I address this topic at the end of the chapter.

The rest of this chapter introduces the concepts behind PL/SQL exception handling, explains the different types of exceptions, and shows how to both raise and handle errors in your code.





Поделиться с друзьями:


Дата добавления: 2015-10-01; Мы поможем в написании ваших работ!; просмотров: 394 | Нарушение авторских прав


Поиск на сайте:

Лучшие изречения:

Самообман может довести до саморазрушения. © Неизвестно
==> читать все изречения...

2487 - | 2329 -


© 2015-2024 lektsii.org - Контакты - Последнее добавление

Ген: 0.013 с.