OpenTP1 Version 7 Programming Guide

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

1.2.1 Using services UAP (SUP)

A UAP dedicated to a client is called a service using program (SUP). An SUP is a UAP which requests the server UAP (SPP) for service and starts communication in client/server mode.

Communication started by an SUP is used only for requesting the SPP for service. It is impossible to create functions for making other UAPs offer service.

The figure below shows the outline of the SUP.

Figure 1-7 Outline of SUP

[Figure]

Organization of this subsection
(1) SUP start
(2) During SUP operation
(3) SUP termination
(4) Outline of SUP processing

(1) SUP start

The SUP can be started either at the same time as OpenTP1 or anytime after OpenTP1 is started. If the first method is selected, UAP processing will start as soon as OpenTP1 starts. The starting time can be selected according to the purpose of the created SUP.

(a) Starting at the same time as OpenTP1

Before starting OpenTP1, specify that the SUP is to start at the same time as OpenTP1. The specification method is as follows:

(b) Starting anytime after OpenTP1 is started

To start the SUP after OpenTP1 is started, specify the user server name of the SUP as the argument to the dcsvstart command.

(2) During SUP operation

Reserve the SUP process as a resident process.

If an error occurs during the SUP process in online mode, the SUP process can be started automatically from another process. In the case of TP1/Server Base, to make another process start the SUP process, specify Y for auto_restart in the user service definition. In the case of TP1/LiNK, automatic startup of the SUP process is specified.

If automatic restart is impossible under OpenTP1, use the dcsvstart command.

(3) SUP termination

SUP termination is not under OpenTP1 control. If the SUP is to be normally terminated when the intended work terminates, design the SUP so that it will terminate itself. If the SUP requests to start a transaction, it must be terminated after commitment the transaction (acquire the synchronization point). If it is necessary to bring the SUP to abnormal termination when processing is unsuccessful, design the SUP so that it will terminate itself by using exit() or abort().

The SUP cannot be normally terminated by the dcsvstop command. However, the SUP can be forced to termination using the dcsvstop -f command.

Do not use the kill command to terminate the SUP process.

(4) Outline of SUP processing

After using the UAP start function (dc_rpc_open()[CBLDCRPC('OPEN ')]) with the SUP, call the user server start completion report function (dc_adm_complete()[CBLDCADM('COMPLETE')]) to post the completion of server start to OpenTP1.

The figure below shows SUP processing.

Figure 1-8 Outline of SUP processing (C language)

[Figure]