0

I have a Java web application (servlets with JSP pages) running on Tomcat 7.0.37 configured with a MySQL database pool with this configuration (set in the context.xml file):

<Context antiJARLocking="true" path="/">
    <Resource 
        name="jdbc/ledenplatform" 
        auth="Container"
        type="javax.sql.DataSource" 
        removeAbandonedTimeout="60"
        removeAbandoned="false" 
        logAbandoned="false"
        factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" 
        initialSize="20" 
        maxActive="100"
        minIdle="20" 
        maxIdle="50"
        maxWait="10000" 
        suspectTimeout="60"
        username="ledenplatform" 
        password="******************"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://ledenplatform.blauwe-regen.be:3306/ledenplatform"
        timeBetweenEvictionRunsMillis="30000" 
        minEvictableIdleTimeMillis="60000"
        testWhileIdle="true" 
        testOnReturn="false" 
        validationQuery="SELECT 1"
        validationInterval="30000" 
        testOnBorrow="true" />
</Context>

After some unknown time/event the pool is slowly running empty and I don't know what event or database action is causing this.

Normally all my DAO classes are correctly closing the connections and closing all prepared statements and result sets after use.

How can I debug this problem?

EDIT:

I did a SHOW FULL PROCESSLIST and got this:

'168278', 'ledenplatform', 'd5152E6EC.static.telenet.be:60296', 'ledenplatform', 'Sleep', '1', '', NULL
'348864', 'ledenplatform', 'ledenplatform.xlshosting.net:51160', 'ledenplatform', 'Sleep', '52', '', NULL
'348865', 'ledenplatform', 'ledenplatform.xlshosting.net:51161', 'ledenplatform', 'Sleep', '52', '', NULL
'348866', 'ledenplatform', 'ledenplatform.xlshosting.net:51162', 'ledenplatform', 'Sleep', '52', '', NULL
'348867', 'ledenplatform', 'ledenplatform.xlshosting.net:51163', 'ledenplatform', 'Sleep', '52', '', NULL
'348868', 'ledenplatform', 'ledenplatform.xlshosting.net:51164', 'ledenplatform', 'Sleep', '52', '', NULL
'348869', 'ledenplatform', 'ledenplatform.xlshosting.net:51165', 'ledenplatform', 'Sleep', '26', '', NULL
'348870', 'ledenplatform', 'ledenplatform.xlshosting.net:51166', 'ledenplatform', 'Sleep', '26', '', NULL
'348871', 'ledenplatform', 'ledenplatform.xlshosting.net:51167', 'ledenplatform', 'Sleep', '21', '', NULL
'348883', 'ledenplatform', 'ledenplatform.xlshosting.net:51179', 'ledenplatform', 'Sleep', '21', '', NULL
'361885', 'ledenplatform', 'd5152E6EC.static.telenet.be:53691', 'ledenplatform', 'Sleep', '36', '', NULL
'377875', 'root', '94-226-251-210.access.telenet.be:54267', 'ledenplatform', 'Sleep', '39', '', NULL
'377876', 'root', '94-226-251-210.access.telenet.be:54268', 'ledenplatform', 'Query', '0', NULL, 'SHOW FULL PROCESSLIST'
Joël Craenhals
  • 475
  • 7
  • 19
  • Define "running empty". You mean there's no available connections? – Brian Roach Jul 17 '13 at 20:11
  • 2
    *Normally all my DAO classes are correctly closing the connections and closing all prepared statements and result sets after use.* probably not. – Luiggi Mendoza Jul 17 '13 at 20:12
  • `SHOW FULL PROCESSLIST` (some useful extra info [here](http://stackoverflow.com/questions/3638689/how-to-see-full-query-from-show-processlist) ) can probably help you zoom in on the culprit, by showing the last query that ran on each connection. – fvu Jul 17 '13 at 20:19
  • I did a SHOW FULL PROCESSLIST. I have added the results to the question above. How to go from here? – Joël Craenhals Jul 18 '13 at 13:42
  • Did you come up with any solution? I am facing the exact same issue. – Mohamed Ennahdi El Idrissi Mar 15 '15 at 21:52

0 Answers0