protectedvoidcreateAndStartCreatorThread(){if(createScheduler==null){StringthreadName="Druid-ConnectionPool-Create-"+System.identityHashCode(this);//启动线程createConnectionThread=newCreateConnectionThread(threadName);createConnectionThread.start();return;}initedLatch.countDown();} ...
protectedvoidcreateAndStartCreatorThread(){if(createScheduler==null){String threadName="Druid-ConnectionPool-Create-"+System.identityHashCode(this);//启动线程createConnectionThread=newCreateConnectionThread(threadName);createConnectionThread.start();return;}initedLatch.countDown();} 而CreateConnectionThread线...
初始化同样是init(),简短了很多,在DataSource上封装了HA必要的逻辑 publicvoidinit(){if(inited){return;}synchronized(this){if(inited){return;}if(dataSourceMap==null||dataSourceMap.isEmpty()){poolUpdater.setIntervalSeconds(poolPurgeIntervalSeconds);poolUpdater.setAllowEmptyPool(allowEmptyPoolWhenUpdate);...
http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=2916633 参数配置比较看这里: http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=6947005 PSCache解决方案看这里: http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=6951277...
1 2 3 protected void recycle(DruidPooledConnection pooledConnection) throws SQLException { ... }所以,使用DruidDataSouce连接池获取数据库连接时,在使用完这个connection之后,如果没有进行close操作,那么activeConnections就不会删除,只会增加。此时因为线程池中动态创建连接的线程CreateConnectionThread中判断一个条件...