The Business Component implements the services associated
with a Logical View. As it runs the service, the Business Component
can detect errors. In this case, it must send all the error information
in its reply message to the client, so that the client can take the
appropriate action.
Principle
When a Business Component detects
an error, it immediately performs a ROLLBACK before
sending back the reply containing the errors. It gives the control
back to the client, without calling the next Business Component
Implementation
- Enter the following options on O-type lines,
in the -GO Lines of the following server entities:
- ACCESERR and DATAERR in
the Business Component. These two options define the number of errors
that the Business Component can detect before giving the control back
to the calling program. For a TUI application, both these options
are required.
- ACCESERR, DATAERR, ERRLAB and ERRSERV in
the Server Dialog for single-view development.
- Describe – in each Business Component and Logical View – the error
messages associated with the codes of the errors specified with specific
code, These errors correspond to the errors set in the Business Component
with the ERU (user error), ERR (error
on Data Element) or ERL (logical lock or unlock
error) operators. You indicate the messages associated with these
errors on U-type lines in the -GE
Linesof the :
- Business Component for the errors specified with ERU or ERL,
- Logical View for the errors on specified with ERR.
Note: You can also modify the messages associated with standard
errors. These errors are detected after standard accesses to Segments
or checks on Logical View data.
- Create and describe the error message server in order to access
the error message file.
To process the errors, four variables are
generated in the
WORKING-STORAGE SECTION of the Business
Component:
- IER: number of errors on Segment access, initialized
by the ACCESERR option,
- IED: number of errors on Data Element, initialized
by the DATAERR option,
- K50L: work index of the number of errors on Segment
access,
- K50D: work index of the number of errors on Data
Element.
- Generate the error message file. The generated file is a sequential
file from which you create the error message file for your application,
with the appropriate organization (relational table, VSAM file...).
An error message file includes 100-character records whose structure
is:
- An access key (ERKEY, 29 characters),
- A gravity code (one character: E for error, W for
warning),
- The message itself.