DML Handlers
A user procedure that processes row LCRs
resulting from DML statements is called a DML handler. An Apply
process can have many DML handlers. Why are these important? It
is because these handlers provide a mechanism to use the LCR
information and execute custom operations on the database
tables. There are many ways in which LCR information can be
utilized. One instance would be to make changes to the payload
and insert them at the destination or develop some kind of audit
trail.
The Error handler is also a DML handler. In
case of the Error handler, the parameter error_handler is
set to TRUE. In this case, the specified user procedure is run
when a row LCR involving the specified operation on the
specified object creates an Apply process error. The user
procedure may try to resolve possible error conditions, or it
may simply notify administrators of the error or it may log the
error.
For each table associated with an Apply
process, a separate DML handler can be set to process each of
the following types of operations in row LCRs:
-
INSERT
-
UPDATE
-
DELETE
-
LOB_UPDATE
For example, the NY4.ALLINSURED1 table may
have one DML handler to process INSERT operations, a different
DML handler to process UPDATE operations, and yet another for
DELETE operations.