3.3.4.4.1.3 Generate Call Path Correlation ID

The correlation ID must be given by the plug-in at the monitoring initiating stage, which is the TA_MONSTAGE value is “STMO”. The Oracle TSAM Plus framework sets PI_CORRID_REQUIRED in the MONITORCTL mon_flag.

If no correlation ID is given, an error is reported. The Oracle TSAM Plus default plug-in provides the correlation ID also. The following two scenarios need to be considered:

  • Working with the Oracle TSAM Plus default plug-in.

    The custom plug-in can skip the correlation ID generation. If the custom plug-in wants to overwrite the correlation ID generated by the Oracle TSAM Plus default plug-in, the interceptor sequence of custom plug-in must come after the Oracle TSAM Plus default plug-in.

  • Working without The Oracle TSAM Plus default plug-in

    If the Oracle TSAM Plus default plug-in is removed from the Oracle Tuxedo plug-in framework, the custom plug-in must supply the correlation ID i. For example:

    if (monctl->mon_flag & PI_CORRID_REQUIRED) {
           strcpy(monctl->corr_id, mygetid());
    }

    mygetid()” is an assumed ID generation routine. The length of the new ID must not exceed the size of corr_id of MONITORCTL.

    To help ID generation, the custom plug-in can use a Oracle TSAM Plus framework service to get a correlation ID. The listing below displays an ID generation example.

ID Generation Example

extern int _TMDLLENTRY tmmon_getcorrid(char *obuf, int len);
...
if (monctl->mon_flag & PI_CORRID_REQUIRED) {
       char new_corrid[MAXCORRIDLEN];
       if (tmmon_getcorrid(new_corrid, sizeof(new_corrid)) == 0 ) {
              strcpy(monctl->corr_id,new_corrid);
       }
}
...

Note:

When using the Oracle TSAM Plus framework correlation ID generation routine, libtsam must be linked with the plug-in.