RSC/MP Programming Manual
Application Development
TMF Code Example
the client must reconnect and communicate with its server to determine if the
transaction was committed. Alternatively, the client application can inform the user that
this situation has occurred. The user can then restart the application and determine if
the transaction was committed.
TMF protection exists only on the host. The actual boundary of a TMF transaction
stops at the TDP. If the workstation or communication connection fails, the TDP aborts
any outstanding transactions by issuing a Guardian ABORTTRANSACTION procedure
call. If the TDP fails, the TMF subsystem automatically aborts the transaction.
RSC/MP does no t extend TMF protection to the workstation. Database rows or records
residing on the workstation are not protected by the TMF subsystem.
TMF Code Example
This code example shows the basic procedure for using RSC/MP to manage TMF
transactions. The sample scenario has the client request a TMF audited operation of a
server. The server returns zero if completely successful or another value if partially
successful.
This clientâs return codes are set for 0 to 100 (inclusive); 999 is acceptable, and all
others are failures. The client either ends (commits) or aborts (rolls back) the
transaction, depending on the va lue of the reply code. The example shows three
examples of how this might be coded:
Using explicit transaction control
Using automatic transaction control
Using automatic transaction control when more than one request (three
RscWriteRead function calls), possibly to different servers, is involved
No RSC/MP API error checking appears in this example; however, in your application,
you should always check for errors. Remember that whether you begin a transaction
explicitly or automatically, the transaction is still active even if the RscWriteRead
function to the server fails. If a transaction is to be ended automatically (using either of
the TMF_OPTION option constants RSC_END_TRANS or
RSC_BEGIN_END_TRANS) and the RscWriteRead function call to the server fails, the
transaction is not automatically ended. Regardless of which constant is used, the
transaction must end explicitly.
HP NonStop Remote Server Call (RSC/MP) Programming Manual â 522360-006
6- 12