接続プールとして3cp0を使用してプログラムを30分ほど実行すると、次の例外が発生します。
エラーは次のとおりです。
[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)
そして私はこのように私のプールを設定しています:
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);
ページをクロールする100個のスレッドがあり、次に結果をデータベースに挿入する15個のDBスレッドがあります。クロールタスクに20秒以上かかる場合は、スレッドを強制終了します。データベース接続プールが停止する理由はありますか?
ありがとう