When I'm redeploying a webap with the org.eclipse.jetty.deploy.
ContextDeployer
I see that the old connections are still there. As you can see in in my
jetty-env.xml, I'm using c3po Resource. I discovered this when i was
looking at communication link failures that i suspect are due to
mysql's 8 hour close connection default strategy.
My question is, how do I destroy the c3po connection pool when redeploying?
Kind regards
Kjell
mysql> SHOW PROCESSLIST ;
+-----+------+-----------------+------------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+------------+---------+------+-------+------------------+
| 341 | root | localhost | NULL | Query | 0 | NULL | SHOW PROCESSLIST |
| 376 | root | localhost:51588 | scheduling | Sleep | 76 | | NULL |
| 377 | root | localhost:51589 | scheduling | Sleep | 16 | | NULL |
| 378 | root | localhost:51590 | scheduling | Sleep | 76 | | NULL |
+-----+------+-----------------+------------+---------+------+-------+------------------+
4 rows in set (0.00 sec)
After redeploy.
mysql> SHOW PROCESSLIST ;
+-----+------+-----------------+------------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-----+------+-----------------+------------+---------+------+-------+------------------+
| 341 | root | localhost | NULL | Query | 0 | NULL | SHOW PROCESSLIST |
| 376 | root | localhost:51588 | scheduling | Sleep | 119 | | NULL |
| 377 | root | localhost:51589 | scheduling | Sleep | 37 | | NULL |
| 378 | root | localhost:51590 | scheduling | Sleep | 119 | | NULL |
| 379 | root | localhost:51592 | scheduling | Sleep | 9 | | NULL |
| 380 | root | localhost:51593 | scheduling | Sleep | 9 | | NULL |
| 381 | root | localhost:51594 | scheduling | Sleep | 9 | | NULL |
+-----+------+-----------------+------------+---------+------+-------+------------------+
7 rows in set (0.00 sec)
<New id="MySqlDS" class="org.eclipse.jetty.plus.jndi.Resource">
<Arg><Ref id='wac'/></Arg>
<Arg>jdbc/MySqlDS</Arg>
<Arg>
<New id="mysqlds" class="com.mchange.v2.c3p0.ComboPooledDataSource">
<Set name="jdbcUrl">jdbc:mysql://
127.0.0.1:10000/scheduling?zeroDateTimeBehavior=convertToNull</Set>
<Set name="driverClass">com.mysql.jdbc.Driver</Set>
<Set name="user">root</Set>
<Set name="maxIdleTime">28400</Set>
<Set name="idleConnectionTestPeriod">300</Set>
<!--Set name="password"></Set-->
</New>
</Arg>
</New>