Issues with External Automatic Entries

Defining Ispecs

An external Automatic Entry requires a minimum of two classes: one on the Originating application (an <<ExternalIspec>> class that does not have any persistent members, that has presentation), and the other (with identical attributes) on the Destination application (<<Ispec>> class that might have persistent members and has presentation).

The <<Ispec>> class (Ispec) on the Originating application must have the AutomaticEntryCapable model property set to True using the Ispec Properties window in Developer. The Ispec on the Destination application accepts external Automatic Entries regardless of its AutomaticEntryCapable property setting.

Note: The first five characters of the transaction identify the Ispec. In earlier versions, Ispec names were limited to a maximum of five characters which meant that the Ispec field in the NOF format had length equal to five. In Agile Business Suite, full Ispec names can be up to 65 characters in length. However, to maintain backwardscompatibility, the NOF format continues to allow only five characters for the Ispec name, and therefore uses the Ispec Alias value (which is limited to five characters)to identify the Ispec.

Three possible designs that represent some of the more common approaches to using external Automatic Entries are described in the following subsections. The coding required for the external Automatic Entry mechanism remains the same, regardless of which design is used.

External Ispecs

An Ispec can be reserved for the use of external Automatic Entries only. You can do this by setting the Ispec’s IsExternal property to True using the properties window in Developer. This avoids the requirement for a physical database structure for an Ispec that is only required for external Automatic Entries, whilst still making all attributes available for their execution.

Refer to the Agile Business Suite Administration Guide for your host platform for more information on how to perform an external Automatic Entry to an External Ispec.

Defining Attributes

The maximum size of the data transferred in an Automatic Entry to another application is 2,000 bytes.

For external Automatic Entries, the Originating and Destination Ispecs must have identical Automatic Entry and Input Buffers. This means that Direction property value and screen order must match, within certain limitations.

The Ispec Type of the Originating Ispec should also match the Ispec Type of the Destination Ispec (for example, Event, Standard, Direct or Table). This is required because of the additional attributes provided automatically by Agile Business Suite (for example, Maint on Standard and Table Type Ispecs).

The actual rule is that the order of attributes within the Automatic Entry Buffer of the client Ispec and the Input Buffer of the server Ispec must match exactly. The screen placement line and position of attributes and their Direction property value define their location in these buffers. The order of attributes within the buffers is shown in the following table.

Agile Business Suite Attribute Properties

Order in the Automatic Entry Buffer

Direction

Persistence

 

InOut

No

Appear first in the buffers, in screen order. These two directions are interchangeable.

InOut

Yes

In

No

In

Yes

None

Yes

Appear second in the buffers, in alphabetic sequence. Refer to the restrictions following the table

Out

No

Appear last in the buffers, in screen order.

Restrictions

When performing external Automatic Entries between hosts with different collating sequences, and if the Automatic Entry <<Ispec>> class contains attributes with Direction set to None, ensure that the order of attributes with Direction set to None does not differ between the applications. This is achieved by careful naming of attributes, as difficulties can often arise when names are chosen with the same alphabetic stem, with both numeric and alphabetic suffixes. For example, F1 and FA would cause problems, whilst F1 and F2 would not.

Note: This restriction applies between UNIX and MCP environments, between OS 2200 and MCP environments, and between Windows and MCP environments.

When applications are generated with the Network Applications Platform (NAP) option, external Automatic Entries can only be performed from Ispecs in subsystem 1. If an external Automatic Entry is attempted from any other subsystem, then an INVALID INDEX error occurs.

Note: The NAP option applies only to MCP based hosts. Refer to the Agile Business Suite Developer User Guide for more information.

Automatic Recovery and Duplicate Protection

Agile Business Suite ensures that in a recovery situation, transactions resubmitted through an external Automatic Entry are not duplicates of completed transactions.

When a transaction fails due to an environmental, system, or software fault, the transaction recovery process is implemented. This guarantees that all uncompleted transactions submitted up to the point of failure are automatically resubmitted during recovery.

As only some participants involved in an external Automatic Entry might be affected by a fault, a mechanism is required to ensure that when transactions are resubmitted by recovery, they do not duplicate already-completed transactions. This process is explained in the following subsections, for each of the following levels of transaction:

Manual Recovery

Within a Originating/Destination environment, you must take care when manually rolling back a subset of the participant databases.

 Caution

There is no automatic method of synchronizing systems in this situation.

Undefined TCP Host Names

External Automatic Entries require that host names are defined.

Sending Multiple External Automatic Entries

If you send multiple external Automatic Entries in the same transaction, ensure they are all sent to the same subsystem. Sending multiple external Automatic Entries in a single transaction to different subsystems might cause loops in the receiving subsystems.

Commit Levels

You can use Glb.Status and Glb.Hubstatus to determine failure of security checks. There are two types of commitment available to external automatic entries: immediate commit or two-phase commit.

Immediate Commit

With immediate commitment, destination applications make (commit) all changes immediately, as follows:

  1. The originating application sends an external automatic entry.

  2. The destination application attempts to commit the changes.

  3. The originating application commits or aborts its changes as appropriate.

    Note: If the originating application sends multiple automatic entries to the same destination application, each automatic entry is treated as a separate transaction.

Two-phase Commit

Two phase commitment ensures that all destination applications are able to commit all changes before any of these applications (including the originating application) commit.

With two-phase commitment:

  1. The originating application sends an external automatic entry.

  2. The destination application determines whether it is able to make (commit) the changes. It processes the transactions, but does not commit the changes to its database.

  3. The destination application sends a message to the originating application to commit the changes.

  4. If the destination application is able to commit, the originating application sends a message to the destination application to commit the changes.

    If the destination application is not able to commit, the originating application sends a message to the destination application to abort the changes.

  5. The originating application then commits or aborts its changes as appropriate.

    Note: If the originating application sends multiple automatic entries to the same destination application, all of the automatic entries are treated as a single transaction.

Series of Automatic Entries

It is possible that an external automatic entry from the originating application causes another external Automatic Entry from the destination application. For example, when application 1 sends an Automatic Entry to application 2, the receiving transaction in application 2 cannot send an Automatic Entry back to application 1 directly, or through other applications.

If this restriction did not exist, a transaction deadlock situation could occur; for example, where application 1 is waiting for application 2, which is waiting for application 3, which is waiting for application 1.

To define the requirements for each application, consider the applications as originating and destination application pairs. Ensure that each application fulfills its role as an originating and destination application.

It is recommended that you use a two-phase commit in this situation. This ensures atomicity, that is, either all automatic entries succeed, or all fail.

Note: Closed cycles (where a destination is one of the originating applications) result in an error. Glb.Status is set to ***** and Glb.Hubstatus is set to Cycle.Error.

Atomicity

Where an external Automatic Entry is made up of several subordinate transactions, the sum of these transactions is called a global transaction.

A global transaction is said to be atomic when, if any one of its subordinate transactions fail, and is backed out, all other subordinate transactions for that global transaction are also backed out. In effect, atomicity is an all-or-nothing process.

The benefits of atomicity are shown in the following examples:

In both examples, if Two-Phase Commit is set, no participating transaction in the global transaction commits until all transactions are ready to commit. This means that the global transaction cannot undergo a partial commit.

Note: When Two-Phase Commit is set to True, if a global transaction is required to be backed out in a situation determined by user logic, the Abort command might be used.

Two-Phase Commit ensures that global transactions are atomic.

Note: The only situations where atomicity could be lost with the Two-Phase Commit option set is when a client or server fail after the decision to commit (or not) has been made. For example, if the originating application has passed the commit message, and is itself at the commit stage, but then fails irrecoverably.

Multilanguage Support

The external Automatic Entry mechanism supports the Agile Business Suite multilanguage facilities on all host types.

The session language of the Originating transaction is passed to the server transactions. (The language name is passed, not the language number.) This language name is used to set Glb.StaLang and the internal pointers to the message and attribute structures in participating Ispecs. If the language name is not defined in a Destination application, Glb.StaLang reverts to the default language of the server application.

The Originating transaction might thus receive replies in the originating language; for example, where logic in the Destination application uses translatable attributes to return errors in the reply.

Note: It is the application developer's responsibility to ensure that the required languages are defined and available on the Destination applications.

Security

The external Automatic Entry facility supports the Security Module (LSM) and additional security features.

The usercode from the originating transaction is passed with the external Automatic Entry, and is automatically moved into Glb.User. Any server application that receives an external Automatic Entry and has its Security Module enabled checks this usercode against its security tables. If the usercode is not valid, the transaction returns a Glb.Status value of five asterisks (*****) and a Glb.HubStatus value of SECURITY.ERROR.

Note: It is the System administrator's responsibility to ensure that the required security levels have been set up on the server applications.

Connection-level security is provided between hosts to guard against unauthorized connections. A password code is passed between participants, using authentication algorithms to ensure that participants are not emulating the HUBRouter protocol. Any mechanism illegally attempting to establish a connection to a by emulating the protocol is denied access.

Note: This security mechanism cannot protect against intruders “piggy-backing” onto an established connection at the TCP packet level. This is a TCP/IP security issue.