@Override public void onBeforeCommit(ConnectionInformation connectionInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "commit", "", "", connectionInformation.getUrl()); } }
@Override public void onBeforeRollback(ConnectionInformation connectionInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "rollback", "", "", connectionInformation.getUrl()); } }
@Override public void onBeforeAnyAddBatch(StatementInformation statementInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "batch", statementInformation.getSqlWithValues(), statementInformation.getStatementQuery(), statementInformation.getConnectionInformation().getUrl()); } }
@Override public void onBeforeAnyExecute(StatementInformation statementInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "statement", statementInformation.getSqlWithValues(), statementInformation.getStatementQuery(), statementInformation.getConnectionInformation().getUrl()); } }
public static void logElapsed(int connectionId, long timeElapsedNanos, Category category, Loggable loggable) { // usually an expensive operation => cache where possible String sql = loggable.getSql(); String url = loggable.getConnectionInformation().getUrl(); if (logger != null && meetsThresholdRequirement(timeElapsedNanos) && isCategoryOk(category) && isLoggable(sql)) { doLogElapsed(connectionId, timeElapsedNanos, category, sql, loggable.getSqlWithValues(), url == null ? "" : url); } else if (isDebugEnabled()) { sql = loggable.getSqlWithValues(); debug("P6Spy intentionally did not log category: " + category + ", statement: " + sql + " Reason: logger=" + logger + ", isLoggable=" + isLoggable(sql) + ", isCategoryOk=" + isCategoryOk(category) + ", meetsTreshold=" + meetsThresholdRequirement(timeElapsedNanos)); } }
@Override public void onBeforeCommit(ConnectionInformation connectionInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "commit", "", "", connectionInformation.getUrl()); } }
@Override public void onBeforeRollback(ConnectionInformation connectionInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "rollback", "", "", connectionInformation.getUrl()); } }
@Override public void onBeforeAnyAddBatch(StatementInformation statementInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "batch", statementInformation.getSqlWithValues(), statementInformation.getStatementQuery(), statementInformation.getConnectionInformation().getUrl()); } }
@Override public void onBeforeAnyExecute(StatementInformation statementInformation) { if (P6OutageOptions.getActiveInstance().getOutageDetection()) { P6OutageDetector.INSTANCE.registerInvocation(this, System.nanoTime(), "statement", statementInformation.getSqlWithValues(), statementInformation.getStatementQuery(), statementInformation.getConnectionInformation().getUrl()); } }
public static void logElapsed(int connectionId, long timeElapsedNanos, Category category, Loggable loggable) { // usually an expensive operation => cache where possible String sql = loggable.getSql(); String url = loggable.getConnectionInformation().getUrl(); if (logger != null && meetsThresholdRequirement(timeElapsedNanos) && isCategoryOk(category) && isLoggable(sql)) { doLogElapsed(connectionId, timeElapsedNanos, category, sql, loggable.getSqlWithValues(), url == null ? "" : url); } else if (isDebugEnabled()) { sql = loggable.getSqlWithValues(); debug("P6Spy intentionally did not log category: " + category + ", statement: " + sql + " Reason: logger=" + logger + ", isLoggable=" + isLoggable(sql) + ", isCategoryOk=" + isCategoryOk(category) + ", meetsTreshold=" + meetsThresholdRequirement(timeElapsedNanos)); } }