5
回答
Druid 连接池异常,出现死锁
百度AI开发者大赛带你边学边开发,赢100万奖金,加群:418589053   

@wenshao 你好,想跟你请教个问题:

项目之前用的是 dbcp 后来频繁出现死锁, 于是改用 Druid , 近一个月以来一直表现良好,但今天又出现系统无反应,日志如下:

"http-8080-101" daemon prio=10 tid=0x7003fc00 nid=0x1dec waiting on condition [0x6c00c000]
   java.lang.Thread.State: WAITING (parking)
	at sun.misc.Unsafe.park(Native Method)
	- parking to wait for  <0x81b1ee58> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park(LockSupport.java:158)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
	at com.alibaba.druid.pool.DruidDataSource.takeLast(DruidDataSource.java:777)
	at com.alibaba.druid.pool.DruidDataSource.getConnectionInternal(DruidDataSource.java:533)
	at com.alibaba.druid.pool.DruidDataSource.getConnectionDirect(DruidDataSource.java:436)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:406)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:396)
	at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:70)

求指导。 配置如下:

    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close">
        <property name="url" value="${jdbc.url}"/>
        <property name="username" value="${jdbc.user}"/>
        <property name="password" value="${jdbc.password}"/>
        <property name="testOnBorrow" value="${jdbc.testOnBorrow}"/>
        <property name="validationQuery" value="${jdbc.validationQuery}"/>
        <property name="maxActive" value="20" />
    </bean>

举报
子木007
发帖于6年前 5回/3K+阅
顶部