skip to main content
OpenAccess SDK SQL Engine core methods for Java : Exchanging data : tm_trace
 

tm_trace

The OpenAccess SDK SQL engine supports the logging method tm_trace to allow method calls, arguments, and other messages to be traced based on a flag provided at runtime. The tm_trace method provides a flexible way to trace events because you can set different levels of tracing with total control over enabling or disabling at runtime.
Insert as many traces as possible, specifically for each error or important event occurring, as well as for each assumption or minor event occurring. Function calls should be traced by placing a trace as the first instruction of each function (using the flag UL_TM_F_TRACE to trace the program flow). Additionally, IP identification and version information should be displayed by the IP initialization routines (using the flag UL_TM_INFO) to facilitate future maintenance. For information about how to control tracing, refer to the OpenAccess SDK Troubleshooting Guide and Reference. The ServiceIPLogOption service attribute controls the tracing level. Log files for each connection are stored in the install_dir/logging directory.
void tm_trace(
long   handle,
int    flag,
String msg)
Table 244. Parameters for tm_trace
Parameter
Type
Description
INPUT
handle
long
The handle to the trace module that was passed in when ipConnect is called.
flag
int
Flag indicating which trace level must be enabled for this trace message to be written to the trace file. See Table 245. The flag and the ServiceIPLogOptions setting determine if the message specified in format is logged at runtime.
msg
String
Message string to be traced.
The flag is a mask defined by the combination of using one or more of the masks listed in Table 245.
Table 245. Trace Flag Masks for use in tm_trace()
Flag Mask
ServiceIPLogOption1
Description
UL_TM_FATAL
Disable All Tracing
Indicates fatal errors, such as cannot get memory or invalid address. Use to enable trace messages that need to be written, no matter what the ServiceIPLogOption attribute is set to.
UL_TM_ERRORS
Enable Error Tracing
Indicates general errors such as invalid user name or password.
UL_TM_MAJOR_EV
Enable Major Events Tracing
Indicates a major application event such as processing schema request.
UL_TM_INFO
Enable Full Tracing
Indicates detailed logging of the IP's activities.
UL_TM_TRIVIA
Enable Verbose Tracing
Indicates very detailed messages. This setting could generate lots of output.

1 The selected logging level and all levels above it are enabled. For example, selecting Enable Major Events will turn on all trace messages that use the flag UL_TM_FATAL, UM_TM_ERRORS, or UL_TM_MAJOR_EV.