TMF Introduction (G06.26+)
TMF Application Programming
HP NonStop TMF Introduction—522414-002
5-9
Transaction Control for Multithreaded Design
C, C++, HP COBOL, and FORTRAN use these calls. HP COBOL programmers use
the ENTER statement. FORTRAN programmers use calls to the TAL procedures.
•
SQL statements are BEGIN WORK, COMMIT WORK, and ROLLBACK WORK.
•
TACL built-in functions are #BEGINTRANSACTION, #ENDTRANSACTION, and
#ABORTTRANSACTION.
Transaction Control for Multithreaded Design
Multithreaded applications use the same transaction control statements as described
for single-threaded design, along with calls to the following TAL procedures:
•
RESUMETRANSACTION, used by programmers coding multithreaded requester
processes. To resume a particular transaction, the application calls the procedure
with the transaction identifier that was returned from the initial
BEGINTRANSACTION call. The specified transaction identifier becomes the
current transaction identifier for the process calling RESUMETRANSACTION.
•
GETTRANSID, used by programmers to obtain the current transaction identifier of
the calling process.
•
ACTIVATERECEIVETRANSID, used by programmers coding $RECEIVE-queuing
servers; these servers queue messages from several requesters concurrently
before replying.
For dealing with heterogeneous transactions, additional control statements are
available. These are described in the TMF Application Programmer’s Guide.
Designing Applications for the Pathway
Environment
Although TMF protects databases in environments other than the Pathway
environment, programmers most commonly design their applications for the Pathway
environment. The following discussion provides a survey of Pathway application
design.
Assigning Roles to Application Modules
An OLTP application defines TMF transactions and accesses audited tables or files in
the database. The modules of a typical OLTP application and their roles in the
transaction environment are illustrated in Figure 5-2.