private void handleEndTransaction(DruidAbstractDataSource dataSource, Savepoint savepoint) {
    if (transactionInfo != null && savepoint == null) {
      transactionInfo.setEndTimeMillis();

      long transactionMillis =
          transactionInfo.getEndTimeMillis() - transactionInfo.getStartTimeMillis();
      dataSource.getTransactionHistogram().record(transactionMillis);

      dataSource.logTransaction(transactionInfo);

      transactionInfo = null;
    }
  }
  protected void transactionRecord(String sql) throws SQLException {
    if (transactionInfo == null && (!conn.getAutoCommit())) {
      DruidAbstractDataSource dataSource = holder.getDataSource();
      dataSource.incrementStartTransactionCount();
      transactionInfo = new TransactionInfo(dataSource.createTransactionId());
    }

    if (transactionInfo != null) {
      transactionInfo.getSqlList().add(sql);
    }
  }