コード例 #1
0
ファイル: ConnectionProxyImpl.java プロジェクト: ywjno/druid
  @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);
  }