Introduction to Tmax Applications

This chapter gives an overview of Tmax application programs and describes their structure and characteristics.

1. Overview

Tmax application programs are client/server programs developed in an open environment that uses Tmax as middleware. The emergence of high-performance PCs and the development of programming technologies have brought about changes from central computing to client/server environments, where task processing is divided between clients and servers. Client/server computing has enabled efficient utilization of resources including the use of high-performance PCs, the scaling down of servers, and the expansion of hardware options.

The client/server environment, however, still has the following problems:

  • Developers must have in-depth knowledge of hardware, operating systems, and network protocols.

  • An increase in the number of users or the amount of data sharply decreases computing speed.

  • Excessive network traffic decreases computing speed.

  • A distributed environment creates problems related to process management, communication, security, and error handling.

Tmax application programs remedy the drawbacks of client/server programs while maintaining their benefits. Application programs based on Tmax as middleware are used to manage communication programs, processes, and transactions. Tmax functions are divided into server library (libsvr.a) and client library (libcli.a) functions that handle buffers, communication, and transactions. These functions comply with the X/Open Data Transaction Processing (DTP) model, which is the international standard for distributed processing.

2. Structure

A Tmax application program consists of a client program and a server program. It requires an environment configuration to use Tmax.

  • Client program

    Client programs request services on behalf of users, receive results from a server, and return the results to users in the user-specified format. These programs require the UNIX configuration file (for example, the .profile file). The UNIX configuration file is used to configure the information, such as the address and port number, necessary for clients to connect to Tmax. Client programs refer to relevant binary files when connecting to Tmax and use struct buffers or field buffers with environment variables in the user configuration file.

  • Server program

    Server programs receive requests from clients, control access to system resources, process client requests, and return the results to clients.

    Server programs consist of the main() task, which is provided and managed by Tmax, and service routines developed by developers. Service routines and service tables created with Tmax utilities are compiled together. If a struct buffer is used, a conversion routine created with a Tmax utility must be run.

    Tmax application servers need server programs and the Tmax configuration file. The Tmax configuration file defines the entire system environment of resources and is written by the administrator. The configuration file is referenced when the Tmax server and server programs are launched. The configuration file is also referenced when service tables are created.

The following figure shows the structure of a Tmax application program.

figure1 1
Tmax Application Program

For more information about client/server programs, refer to Client Programs and Server Programs.

3. Characteristics

Unlike a UNIX program, a Tmax application offers the following features:

  • Compliance with the X/Open Distributed Transaction Processing (DTP) model

    Routines that control the network use Tmax functions, which comply with the international standard. Programs developed in other middleware that comply with the X/Open DTP model are compatible with Tmax.

  • Programs require only service routines that handle client requests.

    Clients must develop programs using general C language syntax, which includes main(). Server programs only require request-processing routines, which do not include main().

  • Service requests can be issued in one of three communication modes.

    Synchronous, asynchronous, and interactive communication modes are supported. With these modes, developers can easily develop programs without deep knowledge of communication networks.

    The following are descriptions of each mode.

    Communication Mode Description

    Synchronous Communication

    Waits for a response after requesting a service request (tpcall).

    Asynchronous Communication

    After requesting a service (tpacall), other tasks are executed until a response (tpgetrply) is received.

    Conversational Communication

    Sends (tpsend) and receives (tprecv) messages repeatedly after the initial connection is made (tpconnect).

    For more information about communication modes, refer to Communication Mode.

  • Seven types of buffers can be used.

    Tmax supports seven types of buffers for requesting a service. In general, developers find it difficult to guarantee data integrity for data communication between different types of devices. That is because different types of hardware and operating systems support different lengths for a certain type of data and methods of allocating data to the memory. Such differences in processing data may cause a value contained in a message to be recognized as another. To avoid this problem, data must be converted into a standard format so that the data can be recognized to hold the same value regardless of what hardware or operating system is used.

    Because Tmax supports various buffers, developers can easily develop programs without deep knowledge of machines, operating systems, and networks. Tmax enhances system performance and reduces network load by providing various buffers including the structure type and the string type.

    For more information about buffers, refer to Buffer Types.

  • Program development is simple.

    • Developers can develop programs without deep knowledge of hardware and communication networks.

    • Clients can request services without knowing the address of the server that handles the request.

    • Clients can request services only with a name.

  • Transaction integrity is guaranteed.

    If the range of transactions is set in a program, Tmax guarantees transaction integrity with two-phase commit (2PC).

    2PC handles transactions in twp phases (prepare phase and commit phase) when multiple databases are integrated. For more information, refer to Transactions.