Using Your Application as a Server
In an OLTP environment, your application is a single OLTP server that provides one or more named services. For an MCP based application, each COMSTP program is a single OLTP server.
Only the Ispecs that you declare as OLTP service-capable can directly receive transactions that originate from within the OLTP environment. OLTP service-capable Ispecs can then recall any other Ispecs (by using the Recall command). Only Ispecs that have been declared as either OLTP service-capable or as OLTP reply-capable can respond to an OLTP transaction. Administration commands are not accepted as valid OLTP transactions.
Your application interacts with the OLTP TM and RMs to support the OLTP Global Transaction (GTR) model. This is required by the host system software in order to process a message submitted by a client application, and includes support of the Two-Phase Commit (2PC) protocol.
When you use your application as a server in an OLTP environment, you need to enable the client and server option, and provide an optional service name using the OLTP Service Name configuration property under the OLTP category for the Segment of the relevant Configuration. On MCP based hosts, you can specify default service names for each subsystem. Mark those Ispecs that are to be OLTP service-capable, by setting to True the Accept OLTP Transaction Ispec configuration property under the OLTP category. Set to True the OLTP Reply configuration property under the OLTP category for any Ispecs that are to be OLTP reply-capable.
Build your application (using the relevant Configuration) to create the configuration information required to register your application as an OLTP server with one or more named Services, including one or more Ispecs associated with each Service name. (A Report cannot be an OLTP server.)
Generation of your application includes the required buffer definitions for use by both OLTP Transaction Managers (TMs) and client applications. Distribute the Service configuration and the buffer definitions to any locations required by the client applications.
How a Server Transaction is Processed
A transaction sent to your application is processed in the following way:
The OLTP message is received by your application.
Agile Business Suite builds a View definition for each OLTP service-capable Ispec. This View is optionally loaded into the OLTP Communications Resource Manager during a build, and is uniquely identified by a Subtype name.
Agile Business Suite receives messages from an OLTP buffer of Type X_COMMON, and a Subtype corresponding to an Ispec that you have defined as OLTP service-capable. built-in segment attributes Glb.OLTPType and Glb.OLTPSubType are set to the buffer Type and Subtype names, and the built-in segment attribute Glb.OLTPService is set to the requested service name.
All attributes within the buffer are type CHAR.
If the Ispec name is not included in the message data, it is determined from the OLTP Subtype name.
For MCP based applications, the Subtype name is:
window_ispec
Your application sets the language to the default (Primary) language at the start of processing of the OLTP transaction. If required, you can change the language within your logic.
If Two-Phase commit (2PC) is in effect for your application, a Global Transaction (GTR) is initiated, unless the request is already part of a GTR.
The message is then passed to the validation logic, Prepare method, and Main method of your Ispec.
Ispec logic is processed in the standard way, although there are some differences in logic commands and attribute. Refer to Using Logic for OLTP for more information.