@Override public void setAutoCommit(boolean autoCommit) throws SQLException { if (!autoCommit) { if (transcationInfo == null) { long transactionId = this.dataSource.createTransactionId(); transcationInfo = new TransactionInfo(transactionId); this.getAttributes() .put(StatFilter.ATTR_TRANSACTION, transcationInfo); // compatible for druid 0.1.18 } } else { transcationInfo = null; } FilterChainImpl chain = createChain(); chain.connection_setAutoCommit(this, autoCommit); recycleFilterChain(chain); }