mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正连接池不能正确被回收的问题
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@537 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -57,6 +57,7 @@ public class JdbcConnectionStat implements JdbcConnectionStatMBean {
|
||||
private long connectLastTime = 0;
|
||||
|
||||
private final AtomicLong closeCount = new AtomicLong(0); // 执行Connection.close的计数
|
||||
private final AtomicLong transactionStartCount = new AtomicLong(0);
|
||||
private final AtomicLong commitCount = new AtomicLong(0); // 执行commit的计数
|
||||
private final AtomicLong rollbackCount = new AtomicLong(0); // 执行rollback的计数
|
||||
|
||||
@@ -94,6 +95,7 @@ public class JdbcConnectionStat implements JdbcConnectionStatMBean {
|
||||
|
||||
connectCount.set(0);
|
||||
closeCount.set(0);
|
||||
transactionStartCount.set(0);
|
||||
commitCount.set(0);
|
||||
rollbackCount.set(0);
|
||||
connectNanoTotal.set(0);
|
||||
@@ -379,6 +381,14 @@ public class JdbcConnectionStat implements JdbcConnectionStatMBean {
|
||||
public void incrementConnectionRollbackCount() {
|
||||
rollbackCount.incrementAndGet();
|
||||
}
|
||||
|
||||
public void incrementTransactionStartCount() {
|
||||
transactionStartCount.incrementAndGet();
|
||||
}
|
||||
|
||||
public long getTransactionStartCount() {
|
||||
return transactionStartCount.get();
|
||||
}
|
||||
|
||||
public static class Entry implements EntryMBean {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user