title: Tomcat not closing connections, remains in sleep mode
body: <p>We are using tomcat 6.0.26 with MySql 5.1, the connection to database is set up in server.xml as given below,</p>
  
  <pre><code>&lt;GlobalNamingResources&gt;
  &lt;!-- Editable user database that can also be used by
       UserDatabaseRealm to authenticate users
  --&gt;
  &lt;Resource name="UserDatabase" auth="Container"
            type="org.apache.catalina.UserDatabase"
            description="User database that can be updated and saved"
            factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
            pathname="conf/tomcat-users.xml" /&gt;
  
   &lt;Resource name="jdbc/abs" type="javax.sql.DataSource"  maxActive="150"   maxIdle="5"  username="XXXXXXXXXXX" testWhileIdle="true"  removeAbandonedTimeout="60"  maxWait="-1" removeAbandoned="true"
      validationQuery="select 1" driverClassName="com.mysql.jdbc.Driver" password="XXXXXXXXXXX" minEvictableIdleTimeMillis="30000" timeBetweenEvictionRunsMillis="300000" url="jdbc:mysql://XXXXXXXXXXXX?autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=utf-8"/&gt;
  
      &lt;Resource driverClassName="com.mysql.jdbc.Driver" maxActive="150" maxIdle="5" maxWait="-1" testWhileIdle="true" minEvictableIdleTimeMillis="30000"  removeAbandonedTimeout="60"  timeBetweenEvictionRunsMillis="300000" name="jdbc/1234" password="XXXXXXXXXXX" removeAbandoned="true" type="javax.sql.DataSource" url="jdbc:mysql:///XXXXXXXXXXXXXXXXXXXXXX?autoReconnect=true&amp;amp;useUnicode=true&amp;amp;characterEncoding=utf-8" username="XXXXXXXXXXX" validationQuery="select 1"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I run show full processlist in MySql it shows a lot of connection remaining in sleep mode, what could be causing this?</p>
  
  <p>Regards,</p>
  
  <p>Rohit</p>