TMF Introduction (G06.26+)

TMF Application Programming
HP NonStop TMF Introduction522414-002
5-11
Developing Requesters Using SCREEN COBOL
as coding requesters and servers, by providing concurrency control, protecting
transactions, and managing database recovery.
Developing Requesters Using SCREEN COBOL
The SCREEN COBOL statements BEGIN-TRANSACTION, END-TRANSACTION,
ABORT-TRANSACTION, and RESTART-TRANSACTION enable Pathway/iTS
applications to use TMF.
BEGIN-TRANSACTION identifies the beginning of a sequence of operations treated as
a single transaction. When this statement executes, the terminal enters transaction
mode, TMF starts a new transaction, and the new transaction identifier (transid) is
assigned to the terminal by the TCP.
After beginning a TMF transaction, the requester always passes the transaction
identifier as the current transid to the server. The transid is associated with the server.
The server’s access to the database is performed under the transaction. Passing the
current transaction to the server is shown in Figure 5-3.
The server receives messages from the requesters in the system file $RECEIVE,
provided for interprocess communication. The server then performs the requested
operations, prepares a response to the requester, and sends a reply to the requester.
Figure 5-3. Passing the Current Transaction to a Server
SCREEN
COBOL
Program
TCP
Requester
...
BEGIN-TRANSACTION.
...
SEND MESSAGE MSG-OUT...
REPLY CODE...
...
END-TRANSACTION.
...
ON-ERROR-PROCEDURE.
ABORT-TRANSACTION.
..
.
Server
Database
Transaction
Entry
Assign
Transid
Access
Identified by
Transid
...
READ MSG-IN
OPEN cursor...
...
FETCH...
...
UPDATE...
CLOSE cursor...
...
WRITE REPLY-MSG
..
.
SQL-COBOL85 Program
Receive
Transid
VST026.vsd