Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Close connections when using a datasource directly, or don't let it be used directly.

オープン
#38 コメント 0 件 リアクション 4 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
clojure
領域
databases

調査の方向性

javax.sql.DataSource 向けの proto/IConnection 実装と、issue に記載されている jdbc/fetch および jdbc/connection のエントリーポイントから始めてください。datasource を直接使用する例と with-open 接続の例を比較してください。完了の条件は、直接使用しても接続リークが発生せず、拒否もされない一方で、ラップした形式は引き続き動作することです。

索引モデルが issue の本文から書いたものです。

説明

javax.sql.DataSource implements the proto/IConnection protocol, but it's difficult to see how directly using it like that is anything but a misfeature. This protocol implementation lets you do the following:

(jdbc/fetch datasource "select whatever from whatever;")

If you do this, the connection that gets created will never get closed. You need to wrap the whole thing in a with-open, jdbc/connection like this:

(with-open [conn (jdbc/connection datasource)]
  (jdbc/fetch conn "select whatever from whatever;"))

Seeing as how the first snippet is always a bad idea, it shouldn't be possible to write the first and have it succeed at all. If we're supposed to go through the connection wrapper jdbc/connection, then the api should force us to do exactly that and not silently succeed when misused.

主要言語
Clojure
スター
106
フォーク
23
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

funcool/clojure.jdbc のほかの issue

funcool/clojure.jdbc の issue をすべて見る

似ている issue

Clojure の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。