1.数据库追踪点加上数据库连接的close操作,用于调试可能的连接泄露

This commit is contained in:
wusheng 2016-01-05 14:53:52 +08:00
parent 0103a3dd37
commit c488d6ee7d
2 changed files with 8 additions and 7 deletions

View File

@ -23,12 +23,6 @@
<artifactId>skywalking-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.ai.cloud</groupId>
<artifactId>skywalking-auth</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>

View File

@ -97,7 +97,14 @@ public class SWConnection implements java.sql.Connection {
}
public void close() throws SQLException {
realConnection.close();
ConnectionTracing.execute(realConnection, connectInfo, "close", "",
new Executable<String>() {
public String exe(java.sql.Connection realConnection,
String sql) throws SQLException {
realConnection.close();
return null;
}
});
}
public boolean isClosed() throws SQLException {