/** * Starts a trace session with an optional trace session name and configuration * * @param traceSessionName * The trace session name (optional) * @param configuration * The trace configuration. For an example, look into fbtrace.conf in the root directory of your * Firebird installation * @throws SQLException */ public void startTraceSession(String traceSessionName, String configuration) throws SQLException { if (configuration == null || configuration.equals("")) { throw new SQLException("No configuration provided"); } if (traceSessionName == null) { traceSessionName = ""; } synchronized (this) { OutputStream currentLogger = getLogger(); if (currentLogger instanceof TraceStream) { currentLogger = ((TraceStream) currentLogger).unwrap(); } setLogger(new TraceStream(currentLogger, traceSessionName)); FbService service = attachServiceManager(); ServiceRequestBuffer traceSPB = getTraceSPB(service, isc_action_svc_trace_start, traceSessionName, configuration); Thread t = new Thread(new TraceTask(service, traceSPB)); t.start(); } }
/** * Starts a trace session with an optional trace session name and configuration * * @param traceSessionName * The trace session name (optional) * @param configuration * The trace configuration. For an example, look into fbtrace.conf in the root directory of your * Firebird installation * @throws SQLException */ public void startTraceSession(String traceSessionName, String configuration) throws SQLException { if (configuration == null || configuration.equals("")) { throw new SQLException("No configuration provided"); } if (traceSessionName == null) { traceSessionName = ""; } synchronized (this) { OutputStream currentLogger = getLogger(); if (currentLogger instanceof TraceStream) { currentLogger = ((TraceStream) currentLogger).unwrap(); } setLogger(new TraceStream(currentLogger, traceSessionName)); FbService service = attachServiceManager(); ServiceRequestBuffer traceSPB = getTraceSPB(service, isc_action_svc_trace_start, traceSessionName, configuration); Thread t = new Thread(new TraceTask(service, traceSPB)); t.start(); } }