From: Simon Brandhof Date: Tue, 25 Jul 2017 21:15:08 +0000 (+0200) Subject: Remove TRACE logs from DbSessionImpl X-Git-Tag: 6.6-RC1~819 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=e5cb819995b40afd98fc49976e35b73ec702d649;p=sonarqube.git Remove TRACE logs from DbSessionImpl These logs are not used in production. --- diff --git a/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java b/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java index e331480cb90..cbfdd9c92d1 100644 --- a/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java +++ b/server/sonar-db-dao/src/main/java/org/sonar/db/DBSessionsImpl.java @@ -45,21 +45,17 @@ public class DBSessionsImpl implements DBSessions { } private DelegatingDbSessionSupplier buildRegularDbSessionSupplier() { - LOG.trace("{} called buildRegularDbSessionSupplier", currentThread()); return new DelegatingDbSessionSupplier(() -> { DbSession res = myBatis.openSession(false); ensureAutoCommitFalse(res); - LOG.trace("{} created regular DbSession {}", currentThread(), res); return res; }); } private DelegatingDbSessionSupplier buildBatchDbSessionSupplier() { - LOG.trace("{} called buildBatchDbSessionSupplier", currentThread()); return new DelegatingDbSessionSupplier(() -> { DbSession res = myBatis.openSession(true); ensureAutoCommitFalse(res); - LOG.trace("{} created batch DbSession {}", currentThread(), res); return res; }); } @@ -79,17 +75,13 @@ public class DBSessionsImpl implements DBSessions { @Override public void enableCaching() { - LOG.trace("{} enabled caching", currentThread()); CACHING_ENABLED.set(Boolean.TRUE); } @Override public DbSession openSession(boolean batch) { - LOG.trace("{} called openSession({}) (caching={})", currentThread(), batch, CACHING_ENABLED.get()); if (!CACHING_ENABLED.get()) { - DbSession res = myBatis.openSession(batch); - LOG.trace("{} created non cached {} session (batch={})", currentThread(), res, batch); - return res; + return myBatis.openSession(batch); } if (batch) { return new NonClosingDbSession(batchDbSession.get().get()); @@ -99,7 +91,6 @@ public class DBSessionsImpl implements DBSessions { @Override public void disableCaching() { - LOG.trace("{} disabled caching", currentThread()); close(regularDbSession, "regular"); close(batchDbSession, "batch"); regularDbSession.remove(); @@ -110,11 +101,9 @@ public class DBSessionsImpl implements DBSessions { public void close(ThreadLocal dbSessionThreadLocal, String label) { DelegatingDbSessionSupplier delegatingDbSessionSupplier = dbSessionThreadLocal.get(); boolean getCalled = delegatingDbSessionSupplier.isPopulated(); - LOG.trace("{} attempts closing on {} session (getCalled={})", currentThread(), label, getCalled); if (getCalled) { try { DbSession res = delegatingDbSessionSupplier.get(); - LOG.trace("{} closes {}", currentThread(), res); res.close(); } catch (Exception e) { LOG.error(format("Failed to close %s connection in %s", label, currentThread()), e);