title: MS SQL JDBC driver create memory leak with JNDI Hikari on Tomcat 9
body: <p>I am using JNDI + HikariCP on Tomcat 9.0.7 with the following configuration :</p>
  
  <pre><code> &lt;Resource name="jdbc/mydb" auth="Container"
        factory="com.zaxxer.hikari.HikariJNDIFactory"
        type="javax.sql.DataSource"
        minimumIdle="5" 
        maximumPoolSize="20"
        connectionTimeout="300000"
        dataSourceClassName="com.microsoft.sqlserver.jdbc.SQLServerDataSource"
        dataSource.url="jdbc:sqlserver://server:1433;databaseName=mydb"      
        dataSource.user="fantomas"
        dataSource.password="somepassword" 
        closeMethod="close"
        /&gt;
  </code></pre>
  
  <p>When I run tomcat without any of my WAR deployed (just standard installation, nothing more), I have the following WARNING in Catalina log:</p>
  
  <pre><code>09-May-2018 10:15:16.971 WARNING [main] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [host-manager] appears to have started a thread named [mssql-jdbc-TimeoutTimer-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
   sun.misc.Unsafe.park(Native Method)
   java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
   java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:460)
   java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:362)
   java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
   java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1073)
   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
   java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>What is wrong and why there is a leak ? How can I fix it ?</p>
  
  <p><strong>UPDATE-1</strong>
  Custom libraries in ./lib of Tomcat installation are:</p>
  
  <pre><code>ms-sql-6.4.0.jre8.jar 
  slf4j-api-1.7.25.jar 
  HikariCP-2.7.8.jar 
  </code></pre>
  
  <p><strong>UPDATE-2</strong>
  Same problem also with Hikari 3.1.0 &amp; Tomcat 9.0.8</p>