Differentiating between an Application and a Transaction Program

The term transaction program has a special meaning in APPC. A transaction program is not an application; it is a section of an application.

A transaction program starts either when an application successfully issues an APPC RECEIVE_ALLOCATE or TP_STARTED verb. Both of these methods identify the transaction program as a new transaction program that APPC needs to know about. APPC reserves a group of memory blocks for the transaction program and creates a unique transaction program identifier, tp_id, which it returns to the calling program.

When an application issues a TP_ENDED verb, APPC clears its buffers for that transaction program and marks the tp_id as not valid. When an application terminates, APPC ends any active transaction programs associated with that process.

When the attach manager receives an allocation request and ensures it is valid, and if a RECEIVE_ALLOCATE is not pending, it starts the application that corresponds to the incoming transaction program name. Notice that it starts a program, not a transaction program. Generally, the application then issues a verb that establishes it as a transaction program. Given mutual consent between the sending node and the local workstation, you can configure the attach manager to start any application in the local workstation.

A transaction program must be established before a conversation can be allocated. An application must supply a tp_id on all conversation verbs that it issues while it is a part of that transaction program. Many conversations can use a single tp_id concurrently (such as in multiple threads) or sequentially (where one conversation follows another). When a transaction program ends, APPC deallocates any active conversations.