OpenTP1 Version 7 Programming Guide

[Contents][Index][Back][Next]

3.8.4 Time monitoring with the facility for user timer monitoring

You can use a function from an MHP or SPP to set time monitoring and to cancel the setting. This facility is called the facility for user timer monitoring. It enables you to monitor a desired time. To use the facility for user timer monitoring, you must specify usertime=yes in the -p option of the MCF communication configuration definition mcfttim.

To set user timer monitoring, call the function dc_mcf_timer_set() [CBLDCMCF('TIMERSET')]. To cancel a user timer monitoring, call the function dc_mcf_timer_cancel() [CBLDCMCF('TIMERCAN')]. Processing for setting and canceling user timer monitoring is run when the function is called regardless of transactions.

At a fixed time monitoring interval, the MCF checks whether timeout has occurred. Specify the time monitoring interval in the btim operand of the -t option of the MCF communication configuration definition mcfttim.

If timeout has occurred, OpenTP1 starts the MHP specified in the arguments of the function dc_mcf_timer_set(). Specifying user data in the arguments of the function dc_mcf_timer_set() causes OpenTP1 to pass the data as a message to the MHP started after timeout occurs.

The mcftlsutm command can be used to display the user timer monitoring status. For details about the mcftlsutm command, see the manual OpenTP1 Operation.

The facility for user timer monitoring can be used under any protocol.

Organization of this subsection
(1) Example
(2) Notes on using the facility for user timer monitoring

(1) Example

The figure below gives an example of using the facility for user timer monitoring. This example shows how the time of responses from a remote system is monitored.

Figure 3-19 Example of using the facility for user timer monitoring

[Figure]

(2) Notes on using the facility for user timer monitoring

  1. User timer monitoring is set or canceled when the relevant function is called. Therefore, processing for setting or canceling user timer monitoring is not disabled even if the transaction is rolled back.
  2. The MHP to be started upon occurrence of timeout must be a nonresponse-type (noans type) MHP. If the MHP specified in the arguments is not nonresponse-type, the function dc_mcf_timer_set() called from an MHP or SPP for setting a user timer monitoring returns an error.
  3. Since OpenTP1 monitors timeout at fixed intervals, an error occurs between the monitoring time specified when the user timer monitoring was set and the time that elapses before actual detection of timeout.
  4. If the function dc_mcf_timer_cancel() is called immediately before the MHP is started due to timeout, the function may return an error with the message Timeout occurred and the MHP may start.
  5. If timeouts occur frequently while you are using the user timer monitoring facility, the performance of normal message control processing is affected. Do not set up normal processing so that an application starts when timeout occurs.
  6. You must specify the maximum number of requests allowed for running a user timer monitoring in the timereqno operand in the -p option of the communication configuration definition mcfttim. Before processing starts, the MCF allocates the same number of monitoring tables as the number of requests specified in this operand. The tables are allocated on static shared memory. Setting one value requires static shared memory equivalent to about 100 bytes + user data size. Add the total capacity of static shared memory on all MCFs to the -p option of the MCF manager definition mcfmcomn and the static_shmpool_size operand of the system environment definition.
  7. If the system goes down while time monitoring is in progress, monitoring is disabled when the system restarts (at rerun). However, if a disk queue is being used as the input queue and the system goes down immediately before the MHP is started due to timeout, the MHP may start after the system restarts. Therefore, we recommend using a memory queue as the input queue.
  8. Note above also applies when the MCF is restarted (rerun) individually.
  9. You cannot set or cancel user timer monitoring for MCFs on other nodes.