views:

37

answers:

1

hi all, I'm getting the following exception after my program runs for 30 minutes or so with 3cp0 as my connection pool.

here's the error:

   [java]  INFO [Timer-0] (BasicResourcePool.java:1392) - A checked-out resource is overdue, and will be destroyed: com.mchange.v2.c3p0.impl.NewPooledConnection@eaecb09
    [java] The last packet successfully received from the server was 375,017 milliseconds ago.  The last packet sent successfully to the server was 9 milliseconds ago.
    [java] Exception in thread "main" java.lang.NullPointerException
    [java]  at com.mytest.myorg.MyProg.MyProgRunner.main(MyProgRunner.java:104)

and I'm setting up my pool like this:

ComboPooledDataSource cpds = new ComboPooledDataSource();
cpds.setDriverClass( "com.mysql.jdbc.Driver" ); //loads the jdbc driver            
cpds.setJdbcUrl( "jdbc:mysql://"+hostname+"/"+database );
cpds.setUser(username);                                  
cpds.setPassword(password);  
cpds.setMinPoolSize(5);                                     
cpds.setAcquireIncrement(5);
cpds.setMaxPoolSize(15);
cpds.setAutoCommitOnClose(true);
cpds.setIdleConnectionTestPeriod(300);
cpds.setMaxStatements(180);
cpds.setNumHelperThreads(20);
cpds.setUnreturnedConnectionTimeout(300);

I have 100 threads that crawl a page then 15 DB threads that insert the results into my database. If a crawl task takes over 20 seconds I kill the thread. Any ideas why the db connection pool just dies?

thanks

A: 

Hi beagleguy,

this forum posting might help you: http://old.nabble.com/A-checked-out-resource-is-overdue--td20545738.html#a20575081

In the case of the killed threads, are the connections returned to the pool?

nhnb