Appendix B. Transaction Resource Management

Managing Failed Transaction Retries and Ispec Resource Consumption

Agile Business Suite Runtime for ClearPath MCP allows the user to define a custom global failed online transaction retries value. It is also possible for the user to manage Ispec resource consumption and Ispec specific failed transaction retries values using Ispec specific properties.

The relevant properties are stored in a file under the usercode of the application. This file is called

(<app usercode>)<system name>/CONSTRAINTS/CONFIG ON <dictionary pack>

Valid properties are:

[GLOBAL]
RETRIES, <n>
WAIT, <wait time>

[ISPECS]
<ispec>,<retries>,<max DB reads>,<max DB writes>,<max elapsed secs>,<max cpu secs>
<ispec2>,<retries>,<max DB reads>,<max DB writes>,<max elapsed secs>,<max cpu secs>

...

<ispecN>,<retries>,<max DB reads>,<max DB writes>,<max elapsed secs>,<max cpu secs>

The description of these properties are described later in the section.

When it is present, the CONSTRAINTS/CONFIG file is loaded at system startup. While the system is active, the CONSTRAINTS/CONFIG file may be reloaded by

All the active constraints may be disabled by

This will disable all active Ispec resource constraints and revert the RETRIES value to the default value (2).

The responses may be viewed from MARC/ODT/Sumlog.

Global Failed Transaction Retries

RETRIES, <n>

<n> indicates the global default failed transaction retries value. Valid values for n are 0 to 3.

0 – Failed transactions will not be retried

1 – Failed transactions will be retried once

2 – Failed transactions will be retried 2 times

3 – Failed transactions will be retried 3 times

The system default value is 2.

Wait Cycle Time for Transaction Checks

WAIT, <wait time>

<wait time> specifies the time interval between transaction checks. Enter the time, in seconds, up to 2 decimal places. For example,

WAIT, 2.56

The range of valid values is 0.5 to 120.

Within the life of a transaction, a comparison between resource constraints and actual resource consumption is made. These comparisons or checks may be done frequently or infrequently. <wait time> is used to specify how much time elapses between checks.

Ispec Resource Consumption

<ispec>,&lt;retries>,<max DB reads>,<max DB writes>,<max elapsed secs>,<max cpu secs>

For any Ispec, include these properties to define values for the following Ispec related properties:

<ispec>

Name of Ispec (up to 5 characters)

<retries>

Transaction failure retries (a zero value indicates that the global or system default value will be used)

<max DB reads>

The number of database reads per transaction

<max DB writes>

The number of database writes per transaction

<max elapsed secs>

The maximum elapsed time per transaction

<max cpu secs>

The maximum CPU time per transaction

If you do not wish to specify a limit for one or more of the properties, enter 0 for the corresponding parameter.

These resource constraint values will be compared by the runtime infrastructure to the Ispec’s actual transaction resource consumption regularly and appropriate action will be taken when one or more of these values is exceeded. To clarify, the user defined resource constraint values are compared to actual resource consumption values from a single transaction, they are not compared to an accumulation of resource consumption values across multiple transactions. More details about comparison of constraint values and actual resource consumption is available later in this section.

Using the Global Properties

Use the RETRIES parameter to define the number of retry attempts before aborting the failed transaction.

Use the WAIT parameter to define how frequently to check the resource consumption for the active transaction.

Specify the Ispecs that are to be monitored.

For example,

[GLOBAL]
RETRIES, 2	
WAIT, 2.56

[ISPECS]
PROD,2,0,0,0,0
CUST,1,0,0,0,0

For this case, the runtime infrastructure will check the resource consumption of any of the defined Ispecs (PROD and CUST) every 2.56 seconds, if they are executing. The WAIT value should be tailored towards the minimum of any defined elapsed (<max elapsed secs>) or CPU time constraint (<max cpu secs>) (except 0). In an ideal situation, the WAIT value should not exceed this minimum value, to improve the accuracy of the monitoring. The minimum value for WAIT of .05 seconds and the maximum value is 120 seconds.

Using the Ispec Properties

The management of specific Ispec properties (with the exception of Retries) requires the presence of interrupt methods, which are owned by the Ispec. The interrupt methods are invoked by the runtime infrastructure when any of the defined resource values are exceeded (For example, maximum database reads, maximum cpu time). The onus is on the user to create them when they are needed.

There are four possible interrupt methods for an Ispec.

The first three interrupt methods are associated with the Ispec cycle method indicated by their name.

The INT_DEFAULT interrupt method is defined when the user does not want to define interrupt methods specifically for one or more of the cycle logic methods and wants to define a generic interrupt method.

If all four interrupt methods are defined, an entry in the Build log will note that the INT__DEFAULT method is ignored, as there are specific interrupt methods defined for all cycle logic methods.

Each of the interrupt methods must be defined with no parameters and no return value. If an interrupt method is created with parameters or a return value, that method will be treated as a normal Ispec method and will not be used as an interrupt method (a generate log warning will be issued for the method).

The interrupt methods are intended to be used by the runtime infrastructure only, and only invoked when they are needed. While there is nothing to prevent user LDL+ logic invoking these methods directly, avoid doing this, the results may be unpredictable.

The interrupt methods themselves may invoke any LDL+ commands including ABORT.

During the deployment of the system, the build processing will update or create the <system name>/CONSTRAINTS/CONFIG file with the details of any Ispec possessing atleast one INT__.. method.

For a file created by the generate process the comments (% in column 1) detailing the record format are also included.

If an Ispec entry is already present in the file, it is skipped as it may have been updated by the user. The Ispec entries that are created in this file by the build processing are added with a default Ispec failure retries value of 2 and no constraints for the other resource values (a zero or missing value, except for <retries>, means no resource constraint).

An example of a CONSTRAINTS/CONFIG file created by the build process -

[GLOBAL]
%Specify Default Failed Transaction Retries	
RETRIES, 2	
%Specify Transaction Checking Wait Cycle Time	                                                       
WAIT, 2.56	
[ISPECS]
%<ispec>,<retries>,<max DB reads>,<max DB writes>,<max elap secs>,<max cpu 
secs>
PROD,2,0,0,0,0

The user may edit the file to update their Ispec specific resource constraint values. Where there is no constraint for a resource, then enter an explicit 0 or leave the remainder blank if no subsequent constraint values are applicable.

For example,

[GLOBAL]
%Specify Default Failed Transaction Retries	
RETRIES, 2	
%Specify Transaction Checking Wait Cycle Time	                                                       
WAIT, 2.56	
[ISPECS]
%<ispec>,<retries>,<max DB reads>,<max DB writes>,<max elap secs>,<max cpu 
secs>
PROD,2,100,0,5.8,2.95
CUST,1,150, 200

From the above, PROD Ispec has a Retries value of 2 and will be monitored for the maximum resource constraints of 100 database reads, 5.8 seconds elapsed time and 2.95 seconds CPU time. There is no constraint for the maximum database writes.

From the above, CUST ispec has a Retries value of 1 and will be monitored for the maximum resource constraints of 150 database reads and 200 database reads. No other constraints have been applied.

Both <max elap secs> and <max cpu secs> may be entered with up to 2 decimals.

Notes:

  • As the checking of the current Ispec resource values is performed at timed intervals (as defined by the WAIT value), it is possible for the Ispec’s processing to have exceeded one or more of the resource constraint limits before it is identified by the runtime infrastructure.

  • If an Ispec exceeds a resource constraint, and no interrupt methods have been defined for the Ispec, interrupt processing will default to setting GLB.STATUS to “*****”.

  • For CopyEvent and CopyIspec classes, each copy cycle is treated independently with respect to resource consumption.

  • When a defined resource exceeds any one of its resource constraints, an appropriate message is displayed on the ODT. For example,

    4032 19:32 DISPLAY:ENV: TRANSACTION CINQ (01) {C} EXCEEDED ELAPSED TIME 2.48 [ 2-2.98] (RETRIES IS 2).

    In the above example, the WAIT time was specified as 0.5 seconds. CINQ is a CopyIspec class which exceeded the resource Elapsed time constraint in copy (01) while executing {C}onstruct logic with a detected elapsed time of 2.48 seconds. The defined constraint limit for CINQ is 2 seconds, but it has consumed 2.98 seconds elapsed so far. This time is the elapsed time until the interrupt was executed from the C85, it may be longer than the detected time, and the executing logic may again hit a further resource constraint limit (including elapsed time) if it resumes processing of this transaction cycle.

    When the Runtime has detected that an Ispec has exceeded one or more constraint limits, then it enables an interrupt for the executing Ispec logic. Depending on what the Ispec logic is doing, it may not honor that interrupt immediately (perhaps, it is waiting on a time or file). The Runtime will wait for a maximum of 10 seconds for an acknowledgement of the interrupt being executed by the Ispec. If a timeout occurs, a ‘PENDING’ message to that effect will appear on the ODT and the Runtime will resume monitoring:

    For example,

        1558 01:42 DISPLAY:ENV: TRANSACTION CUST {P} EXCEEDED ELAPSED TIME 3.46 [3-13.46] (RETRIES IS 0).    
        1558 01:42 DISPLAY:ENV: TRANSACTION CUST - INTERRUPT PENDING
    
  • During deployment, if Appl Bld Tracing is enabled, the Client Build log will identify the Interrupt methods processed during this deployment. For example,

    ECCSE: 17/10/18 @ 19:14:14 Resource Interrupt Methods Processed:
    
    ECCSE: 17/10/18 @ 19:14:14 VEND: DEFAULT Resource Interrupt Method 
    ECCSE: 17/10/18 @ 19:14:14 VEND: MAIN Resource Interrupt Method 
    ECCSE: 17/10/18 @ 19:14:14 PROD: DEFAULT Resource Interrupt Method 
    ECCSE: 17/10/18 @ 19:14:14 CUST: CONSTRUCT Resource Interrupt Method 
    
  • When an Ispec’s resource consumption exceeds any one of its resource constraints, the relevant interrupt method is invoked, then the accumulated resource values for the current transaction are reset to zero before regular Ispec processing resumes. This enables the Ispec to continue processing without another immediate interrupt, if the situation allows for it.

  • After the interrupt processing is complete, (either the user specified INT__ method or the default processing) the Ispec logic will resume from the point at which it was interrupted, unless the interrupt method executes an ABORT command.

  • If no INT__... methods are defined for an Ispec, the user may manually add the Ispec to the <system name> /CONSTRAINTS/CONFIG file for the purpose of managing the Ispec specific transaction failure values. In the example below, if CUST Ispec fails during processing, it will only be retried once. There are no other constraint values for CUST.

    Example

    [GLOBAL]
    %Specify Default Failed Transaction Retries
    RETRIES, 2
    %Specify Transaction Checking Wait Cycle Time                                                       
    WAIT, 2.56
    [ISPECS]
    %<ispec>,<retries>,<max DB reads>,<max DB writes>,<max elap secs>,<max 
    cpu secs>
    PROD,2,100,200,5.8,2.4
    CUST, 1
  • The user may monitor the frequency of all current session Ispecs resource violations through

    • The APPL BLD command CONSTRAINTS n, where n is the system index

      or

    • Lincsupport: Use <Lincsupport mix>AX CONSTRAINTS.

      The response may be viewed from MARC/ODT/Sumlog.

      Note that the OFFENDERS frequency is the number of times that Ispec exceeded a resource constraint which may include multiple times per Construct/Prepare/Main. For example,

      7020 00:13 DISPLAY:ENV: CONSTRAINTS ENABLED: 4 ISPECS,TRANSACTION FAILURE RETRIES= 2,ISPEC MONITOR WAIT= 0.5 SECS,
      OFFENDERS: CINQ=2.
  • The user may disable all current Constraints dynamically through either

    • The APPL BLD command CONSTRAINTS- n, where n is the system index

      or

    • Lincsupport: Use <Lincsupport mix> AX CONSTRAINTS-.

      The response may be viewed from MARC/ODT/Sumlog.

  • The user may reload or enable the <system name>/CONSTRAINTS/CONFIG file dynamically through either

    • The APPL BLD command CONSTRAINTS+ n, where n is the system index

      or

    • Lincsupport: Use <Lincsupport mix>AX CONSTRAINTS+

    The response may be viewed from MARC/ODT/Sumlog.

  • When the application closes, any resource offenders detected during the application’s execution will be written to file <system name>/CONSTRAINTS/OFFENDERS/<mmddyy>/<mix#>, along with a snapshot of the active constraints values.