01.01.2013 Views

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

CICS Transaction Gateway V5 The WebSphere ... - IBM Redbooks

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

322 <strong>CICS</strong> <strong>Transaction</strong> <strong>Gateway</strong> <strong>V5</strong><br />

J2EE resource adapter trace<br />

Resource adapter tracing can either be set programmatically, or by using the<br />

<strong>WebSphere</strong> administrative console to change properties in the connection<br />

factory.<br />

Programmatic trace control<br />

Resource adapter tracing is set programmatically using the<br />

ECIManagedConnectionFactory object. Two steps must be taken to enable<br />

tracing:<br />

1. Turn logging on through the setLogWriter() method.<br />

2. Specify the level of tracing using the setTraceLevel() method as shown:<br />

ECIManagedConnectionFactory mcf = new ECIManagedConnectionFactory();<br />

mcf.setLogWriter(new java.io.PrintWriter(System.out));<br />

mcf.setTraceLevel(new Integer(mcf.RAS_TRACE_INTERNAL));<br />

Valid levels of tracing are as follows, with each level of trace building upon the<br />

previous level. <strong>The</strong>refore, ENTRY_EXIT includes everything in<br />

ERROR_EXCEPTION, and INTERNAL includes all trace levels:<br />

RAS_TRACE_OFF Disable all tracing<br />

RAS_TRACE_ERROR_EXCEPTION Output exception trace stacks<br />

RAS_TRACE_ENTRY_EXIT Output method entry and exit stack traces<br />

RAS_TRACE_INTERNAL Output debug trace entries<br />

.<br />

Tip: We found that the <strong>CICS</strong> resource adapter trace traced the execution of<br />

methods only within the resource adapter itself. <strong>The</strong> resource adapter acts as<br />

a client to the <strong>CICS</strong> TG classes, so enabling <strong>CICS</strong> TG Java client tracing will<br />

provide extra information. We suggest that you combine J2EE resource<br />

adapter trace with the use of the com.ibm.ctg.client.T class, since this will<br />

provide end-to-end debug information.<br />

Managed connections<br />

Tracing on a connection factory is set using the TraceLevel property of the<br />

connection factory resource. To modify tracing, from the <strong>WebSphere</strong><br />

administrative console expand <strong>WebSphere</strong> Administrative Domain -><br />

Resources -> J2C Resource Adapters -> <strong>CICS</strong> ECI and click J2C Connection<br />

Factories. Click the connection factory instance and then click the Connections<br />

tab. <strong>The</strong> TraceLevel property controls the tracing (Figure 11-32 on page 323).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!