2.2 Using tsambegin()/tsamend() in Oracle Tuxedo Service
The following is an example that defines tsambegin()and tsamend() in the file toupper:
Defining tsambegin() and tsamend()
#include <tsam_ext.h>
void
TOUPPER(TPSVCINFO *rqst)
{
...
long seq;
int db_rtn;
char * begin_props[] = { "sql=update..."};
char * end_props[1];
seq = tsambegin("DB", "Update", 1, begin_props, 0L);
userlog("seq=%ld", seq);
if(seq >= 0){
char str_dbrtn[100];
sprintf(str_dbrtn, "Database Return=%d", db_rtn);
end_props[0] = str_dbrtn;
tsamend(seq, sizeof(end_props)/sizeof(end_props[0]), end_props, 0L);
}
....
}
Run the following command to build the file toupper.c:
buildserver -s TOUPPER -o toupper -f toupper.c -f ${TUXDIR}/lib/tsam_ext.o
For more information about tsambegin()and tsamend(), see Call Path Monitoring APIs in Oracle TSAM Plus Reference Guide.
Parent topic: Extended Call Path Monitoring