@Override public SailConnection getConnection() throws SailException { initializationLock.readLock().lock(); try { if (!isInitialized()) { throw new IllegalStateException("Sail is not initialized or has been shut down"); } SailConnection connection = getConnectionInternal(); Throwable stackTrace = debugEnabled() ? new Throwable() : null; synchronized (activeConnections) { activeConnections.put(connection, stackTrace); } return connection; } finally { initializationLock.readLock().unlock(); } }
@Override public SailConnection getConnection() throws SailException { initializationLock.readLock().lock(); try { if (!isInitialized()) { throw new IllegalStateException("Sail is not initialized or has been shut down"); } SailConnection connection = getConnectionInternal(); Throwable stackTrace = debugEnabled() ? new Throwable() : null; synchronized (activeConnections) { activeConnections.put(connection, stackTrace); } return connection; } finally { initializationLock.readLock().unlock(); } }