Skip navigation.

ATMI COBOL Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


TPSVRINIT(3cbl)

Name

TPSVRINIT() - BEA Tuxedo ATMI server initialization routine

Synopsis

LINKAGE SECTION. 

01
CMD-LINE.
05 ARGC PIC 9(4) COMP-5.
05 ARGV.
10 ARGS PIC X OCCURS 0 TO 9999 DEPENDING ON ARGC
.
01
TPSTATUS-REC.
COPY TPSTATUS.
PROCEDURE DIVISION USING
CMD-LINE TPSTATUS-REC.
* User code
EXIT PROGRAM

Description

The BEA Tuxedo ATMI server abstraction calls TPSVRINIT() during its initialization. This routine is called after the program has become a server but before it handles any service requests; thus, BEA Tuxedo ATMI communication may be performed and transactions may be defined in this routine. However, if TPSVRINIT() returns with either open connections or asynchronous replies pending, or while still in transaction mode, the BEA Tuxedo system closes the connections, ignores any pending replies, and aborts the transaction before the server exits.

If an application does not provide this routine in a server, then the default version provided by the BEA Tuxedo system is called, instead. The default TPSVRINIT() calls TPOPEN() and USERLOG() to announce that the server has started successfully.

Application-specific options can be passed into a server and processed in TPSVRINIT(). (For details, see servopts(5)). The options are passed through ARGC and ARGV. ARGC contains the number of arguments that have been passed; ARGV, the content of those arguments, specified in character format with single spaces separating arguments. getopt() is used in a BEA Tuxedo system.

If successful, TPSVRINIT() returns [TPOK] in TP-STATUS and the service can start accepting requests. If an error occurs in TPSVRINIT, the application can cause the server to exit gracefully (without taking any service requests) by returning any value other than [TPOK] in TP-STATUS.

When TPSVRINIT() returns any value other than [TPOK], the system does not restart the server. Instead, the administrator must run tmboot to restart the server.

Return Values

When TPRETURN()or TPFORWAR() is used outside a service routine (for example, in a client, TPSVRINIT(), or TPSVRDONE()), then the routine returns with no effect.

Usage

When called in TPSVRINIT(), the TPRETURN() and TPFORWAR() routines simply return with no effect.

See Also

TPOPEN(3cbl), TPSVRDONE(3cbl)

 

Skip navigation bar  Back to Top Previous Next