Progress
ADM 2 Guide
Database Trigger Procedures
Database trigger procedures are not part of the SmartDataObject model, and Progress Software Corporation recommends that you limit them to performing essential data integrity checks. There are two reasons for this recommendation:
By moving as much as possible of the application’s business logic as far from the database transaction as possible, you ensure that most data errors are reported earlier and more efficiently. If a database trigger fails during a SmartDataObject update, the transaction is aborted and the error message, if any, is reported back to the client object, where either the data must be modified or the update canceled.
The ADM provides a standard error reporting mechanism that database triggers can use. This mechanism, the addMessage procedure, allows the SmartDataObject to log one or more error messages and return them in a standard format to a visualization or other client object, which can then present them to the user as appropriate, including repositioning the cursor to the field where the error occurred. The addMessage procedure takes as arguments the message text, the field name, if applicable, and the table name, if applicable. If database trigger procedures run addMessage, these messages are returned to the client visualization for display, even across an AppServer connection. Note that MESSAGE statements are not transmitted across an AppServer connection and are not, therefore, an appropriate way to log error messages in any database that might be used in distributed applications.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |