Subject: [pgjdbc/pgjdbc] PR #3980: fix Enable cursor-based bug, when start transaction by 'START TRANSAC…

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Sun, 22 Mar 2026 13:36:11 +0000

…TION ' command.

### All Submissions:

* [ ] Have you followed the guidelines in our [Contributing](https://github.com/pgjdbc/pgjdbc/blob/master/CONTRIBUTING.md) document?
* [ ] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### New Feature Submissions:

1. [ ] Does your submission pass tests?
2. [ ] Does `./gradlew styleCheck` pass ?
3. [ ] Have you added your new test classes to an existing test suite in alphabetical order?

### Changes to Existing Features:

* [ ] Does this break existing behaviour? If so please explain.
* [ ] Have you added an explanation of what your changes do and why you'd like us to include them?
* [ ] Have you written new tests for your core changes, as applicable?
* [ ] Have you successfully run tests with your changes locally?

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Sun, 22 Mar 2026 13:36:43 +0000

fix Enable cursor-based bug, when start transaction by 'START TRANSACTION ' command.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Sun, 22 Mar 2026 16:58:32 +0000

what does this fix? Do you have a way to reproduce it?

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Sun, 22 Mar 2026 21:22:12 +0000

> what does this fix? Do you have a way to reproduce it?

I reproduce , see https://github.com/PillArmy/army/blob/master/army-example/src/test/java/io/army/temp/PostgreBugReproduce.java

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Sun, 22 Mar 2026 21:27:04 +0000

(on pgjdbc/src/main/java/org/postgresql/jdbc/PgStatement.java:459)

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Sun, 22 Mar 2026 21:30:13 +0000

> what does this fix? Do you have a way to reproduce it?

I write the jdbd-postgre , https://github.com/PillArmy/jdbd-postgre , so it clear,I know it

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Sun, 22 Mar 2026 21:40:06 +0000

For this bug, I have to do more ,for example :
https://github.com/PillArmy/army/blob/master/army-jdbc/src/main/java/io/army/jdbc/JdbcExecutor.java#L1310

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Mon, 23 Mar 2026 09:27:13 +0000

So I'm curious why are you using start transaction readonly when there is an API for this?
setAutoCommit(false) and setReadOnly(true)

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Mon, 23 Mar 2026 09:31:18 +0000

Could you add a test case to cover the change?

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Mon, 23 Mar 2026 09:51:42 +0000

> So I'm curious why are you using start transaction readonly when there is an API for this? setAutoCommit(false) and setReadOnly(true)

Because ,Jdbc js bad design,Starting a database transaction should maintain integrity, so it must be a single SQL statement.   This is good design , startTransaction(TransactionOption option).

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Mon, 23 Mar 2026 09:55:30 +0000

> Could you add a test case to cover the change?
Can I commit one issue, and you write the code ?

---

From: "qinarmy-zoro (@qinarmy-zoro)" <[email-masked]>
Date: Mon, 23 Mar 2026 10:20:02 +0000

I commit one issue，and close the poll request.
see https://github.com/pgjdbc/pgjdbc/issues/3993