/** * List all currently registered trace sessions * * @throws SQLException */ public void listTraceSessions() throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_list)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }
public void run() { try { System.out.println("Start trace"); try (FbService service = this.service) { executeServicesOperation(service, srb); } System.out.println("Trace stopped"); } catch (SQLException e) { // ignore } } }
/** * 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(); } }
/** * Creates and returns the "trace" service request buffer for the Service * Manager. * * @param service Service handle * @param action * The isc_action_svc_trace_* action to be used * @param traceSessionId * The trace session ID * @return the "trace" service request buffer for the Service Manager. * @throws SQLException */ private ServiceRequestBuffer getTraceSPB(FbService service, int action, int traceSessionId) throws SQLException { ServiceRequestBuffer traceSPB = getTraceSPB(service, action); traceSPB.addArgument(isc_spb_trc_id, traceSessionId); return traceSPB; }
/** * 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(); } }
/** * Creates and returns the "trace" service request buffer for the Service * Manager. * * @param service Service handle * @param action * The isc_action_svc_trace_* action to be used * @param traceSessionId * The trace session ID * @return the "trace" service request buffer for the Service Manager. * @throws SQLException */ private ServiceRequestBuffer getTraceSPB(FbService service, int action, int traceSessionId) throws SQLException { ServiceRequestBuffer traceSPB = getTraceSPB(service, action); traceSPB.addArgument(isc_spb_trc_id, traceSessionId); return traceSPB; }
/** * List all currently registered trace sessions * * @throws SQLException */ public void listTraceSessions() throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_list)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }
/** * Creates and returns the "trace" service request buffer for the Service Manager. * * @param service Service handle * @param action * The isc_action_svc_trace_* action to be used * @param traceSessionName * The trace session name * @param configuration * The trace configuration. For an example, look into fbtrace.conf in the root directory of your Firebird * installation * @return the "trace" service request buffer for the Service Manager. * @throws SQLException */ private ServiceRequestBuffer getTraceSPB(FbService service, int action, String traceSessionName, String configuration) throws SQLException { ServiceRequestBuffer traceSPB = getTraceSPB(service, action); traceSPB.addArgument(isc_spb_trc_name, traceSessionName); traceSPB.addArgument(isc_spb_trc_cfg, configuration); return traceSPB; }
public void run() { try { System.out.println("Start trace"); try (FbService service = this.service) { executeServicesOperation(service, srb); } System.out.println("Trace stopped"); } catch (SQLException e) { // ignore } } }
/** * Suspends a trace session with the given trace session ID * * @param traceSessionId * The trace session ID * @throws SQLException */ public void suspendTraceSession(int traceSessionId) throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_suspend, traceSessionId)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }
/** * Creates and returns the "trace" service request buffer for the Service Manager. * * @param service Service handle * @param action * The isc_action_svc_trace_* action to be used * @param traceSessionName * The trace session name * @param configuration * The trace configuration. For an example, look into fbtrace.conf in the root directory of your Firebird * installation * @return the "trace" service request buffer for the Service Manager. * @throws SQLException */ private ServiceRequestBuffer getTraceSPB(FbService service, int action, String traceSessionName, String configuration) throws SQLException { ServiceRequestBuffer traceSPB = getTraceSPB(service, action); traceSPB.addArgument(isc_spb_trc_name, traceSessionName); traceSPB.addArgument(isc_spb_trc_cfg, configuration); return traceSPB; }
/** * Stops a trace session with the given trace session ID * * @param traceSessionId * The trace session ID * @throws SQLException */ public void stopTraceSession(int traceSessionId) throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_stop, traceSessionId)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }
/** * Resumes a trace session with the given trace session ID * * @param traceSessionId * The trace session ID * @throws SQLException */ public void resumeTraceSession(int traceSessionId) throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_resume, traceSessionId)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }
/** * Suspends a trace session with the given trace session ID * * @param traceSessionId * The trace session ID * @throws SQLException */ public void suspendTraceSession(int traceSessionId) throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_suspend, traceSessionId)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }
/** * Resumes a trace session with the given trace session ID * * @param traceSessionId * The trace session ID * @throws SQLException */ public void resumeTraceSession(int traceSessionId) throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_resume, traceSessionId)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }
/** * Stops a trace session with the given trace session ID * * @param traceSessionId * The trace session ID * @throws SQLException */ public void stopTraceSession(int traceSessionId) throws SQLException { try (FbService service = attachServiceManager()) { service.startServiceAction(getTraceSPB(service, isc_action_svc_trace_stop, traceSessionId)); queueService(service); } catch (IOException ioe) { throw new SQLException(ioe); } }