Message-ID: From: "helloJosh (@helloJosh)" To: "pgjdbc/pgjdbc" Date: Mon, 24 Nov 2025 15:51:40 +0000 Subject: [pgjdbc/pgjdbc] PR #3870: feat: Add INFO log when fetchSize is ignored under autocommit=true List-Id: X-GitHub-Author-Id: 37134368 X-GitHub-Author-Login: helloJosh X-GitHub-Issue: 3870 X-GitHub-Repo: pgjdbc/pgjdbc X-GitHub-State: closed X-GitHub-Type: pull_request X-GitHub-Url: https://github.com/pgjdbc/pgjdbc/pull/3870 Content-Type: text/plain; charset=utf-8 First of all, Thank you for maintaining pgjdbc. As someone who relies on PostgreSQL heavily, I really appreciate the effort that goes into this project If it's not too much trouble, I would like to get feedback on whether adding this log message is acceptable. ### Motivation While using Spring Batch with JdbcCursorItemReader, our application repeatedly hit OOM because fetchSize was silently ignored when the connection ran with autocommit=true. Although the documentation notes that server-side cursors require autocommit=false, this detail becomes easy to miss when multiple application are involved. I initially considered implementing a WITH HOLD cursor, but the complexity was non-trivial. So, I am proposing to surface this behavior through an INFO-level log. ### Why INFO - Users typically set fetchSize because the result set is large. - Many users expect streaming behavior even when autocommit is true(or may not realize autocommit is enabled). - This log appears only when fetchSize > 0 and autocommit=true, so it does not introduce noisy logging in unrelated cases. ### What is changed - Add an INFO-level log in PgStatement.executeInternal when: - fetchSize > 0 - autocommit = true - when driver connot use a server-side cursor - No behavior change - cursor flags untouched - No new test - tests passed locally