connectionCounter.setLastStatementStatckTrace(new Exception());
}
// //////////SQL
JdbcSqlStat sqlStat = getSqlStat(statement);
if (sqlStat == null) {
sqlStat = createSqlStat(statement, sql);
statement.getAttributes().put(ATTR_SQL, sqlStat);
}
JdbcStatContext statContext = JdbcStatManager.getInstance().getStatContext();
if (statContext != null) {
sqlStat.setName(statContext.getName());
sqlStat.setFile(statContext.getFile());
}
if (sqlStat != null) {
sqlStat.setExecuteLastStartTime(System.currentTimeMillis());
sqlStat.incrementRunningCount();
try {
boolean inTransaction = !statement.getConnectionProxy().getAutoCommit();
if (inTransaction) {
sqlStat.incrementInTransactionCount();
}
} catch (SQLException e) {
LOG.error("getAutoCommit error", e);
}
}