//if the connection pool is closed\r
//close the connection instead of returning it\r
release(con);\r
- return;\r
+ return; \r
} //end if\r
\r
if (con != null) {\r
\r
public void checkAbandoned() {\r
try {\r
- long now = System.currentTimeMillis();\r
+ if (busy.size()==0) return;\r
Iterator<PooledConnection> locked = busy.iterator();\r
while (locked.hasNext()) {\r
PooledConnection con = locked.next();\r
if (idle.contains(con))\r
continue;\r
long time = con.getTimestamp();\r
+ long now = System.currentTimeMillis();\r
if ((now - time) > con.getAbandonTimeout()) {\r
busy.remove(con);\r
abandon(con);\r
\r
public void checkIdle() {\r
try {\r
+ if (idle.size()==0) return;\r
long now = System.currentTimeMillis();\r
Iterator<PooledConnection> unlocked = idle.iterator();\r
while ( (idle.size()>=getPoolProperties().getMinIdle()) && unlocked.hasNext()) {\r
\r
public void testAllIdle() {\r
try {\r
+ if (idle.size()==0) return;\r
Iterator<PooledConnection> unlocked = idle.iterator();\r
while (unlocked.hasNext()) {\r
PooledConnection con = unlocked.next();\r
this.datasource.getPoolProperties().setTimeBetweenEvictionRunsMillis(1000);\r
this.datasource.getPoolProperties().setMaxActive(20);\r
this.datasource.getPoolProperties().setMaxWait(3000);\r
- this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5000);\r
+ this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5);\r
this.datasource.getPoolProperties().setMinEvictableIdleTimeMillis(5000);\r
this.datasource.getPoolProperties().setMinIdle(5);\r
this.datasource.getPoolProperties().setLogAbandoned(true);\r
this.datasource.getPoolProperties().setTimeBetweenEvictionRunsMillis(1000);\r
this.datasource.getPoolProperties().setMaxActive(20);\r
this.datasource.getPoolProperties().setMaxWait(3000);\r
- this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5000);\r
+ this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5);\r
this.datasource.getPoolProperties().setMinEvictableIdleTimeMillis(5000);\r
this.datasource.getPoolProperties().setMinIdle(5);\r
this.datasource.getPoolProperties().setLogAbandoned(true);\r
this.datasource.getPoolProperties().setTimeBetweenEvictionRunsMillis(1000);\r
this.datasource.getPoolProperties().setMaxActive(20);\r
this.datasource.getPoolProperties().setMaxWait(3000);\r
- this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5000);\r
+ this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5);\r
this.datasource.getPoolProperties().setMinEvictableIdleTimeMillis(5000);\r
this.datasource.getPoolProperties().setMinIdle(5);\r
this.datasource.getPoolProperties().setRemoveAbandoned(true);\r
this.datasource.getPoolProperties().setTimeBetweenEvictionRunsMillis(1000);\r
this.datasource.getPoolProperties().setMaxActive(20);\r
this.datasource.getPoolProperties().setMaxWait(3000);\r
- this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5000);\r
+ this.datasource.getPoolProperties().setRemoveAbandonedTimeout(5);\r
this.datasource.getPoolProperties().setMinEvictableIdleTimeMillis(5000);\r
this.datasource.getPoolProperties().setMinIdle(5);\r
this.datasource.getPoolProperties().setRemoveAbandoned(true);\r