Subject: [pgjdbc/pgjdbc] PR #3905: remove old comment about finalize, guard closed flag with a reentrant lock to protect against concurrent close.

From: "davecramer (@davecramer)" <[email-masked]>
Date: Tue, 06 Jan 2026 13:35:59 +0000

Fixes #3904

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Thu, 08 Jan 2026 09:49:09 +0000

(on pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java)

Having a lock in a single place only does not sound right to me.
If we add a lock, we should probably cover the other methods like `read`, `write`, `truncate` for consistency.

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Thu, 08 Jan 2026 09:49:41 +0000

WDYT of the following?
```suggestion
      if (closed) {
        return;
      }
      closed = true;
```

It would reduce the nesting level

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 08 Jan 2026 10:59:03 +0000

Strange, we don't check for closed anywhere else in the code...

---

From: "vlsi (@vlsi)" <[email-masked]>
Date: Thu, 08 Jan 2026 11:27:00 +0000

Yeah, we could probably check it provided the spec permits

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Thu, 08 Jan 2026 11:43:06 +0000

Done, and added checks for isClosed