mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
commit & rollback stat
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@733 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -170,6 +170,26 @@ public abstract class DruidAbstractDataSource implements DruidAbstractDataSource
|
||||
|
||||
protected boolean breakAfterAcquireFailure = false;
|
||||
|
||||
protected final AtomicLong commitCount = new AtomicLong();
|
||||
protected final AtomicLong rollbackCount = new AtomicLong();
|
||||
|
||||
|
||||
public long getCommitCount() {
|
||||
return commitCount.get();
|
||||
}
|
||||
|
||||
public void incrementCommitCount() {
|
||||
commitCount.incrementAndGet();
|
||||
}
|
||||
|
||||
public long getRollbackCount() {
|
||||
return rollbackCount.get();
|
||||
}
|
||||
|
||||
public void incrementRollbackCount() {
|
||||
rollbackCount.incrementAndGet();
|
||||
}
|
||||
|
||||
public boolean isBreakAfterAcquireFailure() {
|
||||
return breakAfterAcquireFailure;
|
||||
}
|
||||
@@ -209,12 +229,12 @@ public abstract class DruidAbstractDataSource implements DruidAbstractDataSource
|
||||
public void setValidConnectionChecker(ValidConnectionChecker validConnectionChecker) {
|
||||
this.validConnectionChecker = validConnectionChecker;
|
||||
}
|
||||
|
||||
|
||||
public String getValidConnectionCheckerClassName() {
|
||||
if (validConnectionChecker == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
return validConnectionChecker.getClass().getName();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user