This commit is contained in:
温少
2012-03-21 01:52:26 +08:00
parent 3d7d476e0d
commit c518d8f39e
19 changed files with 137 additions and 121 deletions
@@ -59,6 +59,7 @@ import com.alibaba.druid.stat.JdbcStatManager;
import com.alibaba.druid.util.ConcurrentIdentityHashMap;
import com.alibaba.druid.util.DruidLoaderUtils;
import com.alibaba.druid.util.Histogram;
import com.alibaba.druid.util.IOUtils;
import com.alibaba.druid.util.JdbcUtils;
/**
@@ -1130,7 +1131,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
public List<String> getActiveConnectionStackTrace() {
List<String> list = new ArrayList<String>();
for (ActiveConnectionTraceInfo traceInfo : this.activeConnections.values()) {
list.add(JdbcUtils.toString(traceInfo.getStackTrace()));
list.add(IOUtils.toString(traceInfo.getStackTrace()));
}
return list;
@@ -1375,7 +1376,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
if (lastConnectionConnectError != null) {
map.put("ConnectionConnectErrorLastTime", stat.getConnectionStat().getErrorLastTime());
map.put("ConnectionConnectErrorLastMessage", lastConnectionConnectError.getMessage());
map.put("ConnectionConnectErrorLastStackTrace", JdbcUtils.getStackTrace(lastConnectionConnectError));
map.put("ConnectionConnectErrorLastStackTrace", IOUtils.getStackTrace(lastConnectionConnectError));
} else {
map.put("ConnectionConnectErrorLastTime", null);
map.put("ConnectionConnectErrorLastMessage", null);
@@ -1398,7 +1399,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
map.put("StatementLastErrorTime", stat.getStatementStat().getLastErrorTime());
map.put("StatementLastErrorMessage", lastStatementError.getMessage());
map.put("StatementLastErrorStackTrace", JdbcUtils.getStackTrace(lastStatementError));
map.put("StatementLastErrorStackTrace", IOUtils.getStackTrace(lastStatementError));
} else {
map.put("StatementLastErrorTime", null);
map.put("StatementLastErrorMessage", null);
@@ -1424,7 +1425,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
Throwable lastResultSetError = stat.getResultSetStat().getLastError();
if (lastResultSetError != null) {
map.put("ResultSetLastErrorMessage", lastResultSetError.getMessage());
map.put("ResultSetLastErrorStackTrace", JdbcUtils.getStackTrace(lastResultSetError));
map.put("ResultSetLastErrorStackTrace", IOUtils.getStackTrace(lastResultSetError));
} else {
map.put("ResultSetLastErrorMessage", null);
map.put("ResultSetLastErrorStackTrace", null);
@@ -1435,7 +1436,7 @@ public abstract class DruidAbstractDataSource extends WrapperAdapter implements
Throwable lastConnectionError = stat.getConnectionStat().getErrorLast();
if (lastConnectionError != null) {
map.put("ConnectionErrorLastMessage", lastConnectionError.getMessage());
map.put("ConnectionErrorLastStackTrace", JdbcUtils.getStackTrace(lastConnectionError));
map.put("ConnectionErrorLastStackTrace", IOUtils.getStackTrace(lastConnectionError));
} else {
map.put("ConnectionErrorLastMessage", null);
map.put("ConnectionErrorLastStackTrace", null);