Subject: [pgjdbc/pgjdbc] issue #3904: Should this be protected with a reentrant lock?

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

https://github.com/pgjdbc/pgjdbc/blob/83023f3c2ae98dc69df00a560dbbe386afafe3b1/pgjdbc/src/main/java/org/postgresql/largeobject/LargeObject.java#L163

If this were called concurrently, seems like close might not be set before some operations have been done such as setting os to null

---

From: "sehrope (@sehrope)" <[email-masked]>
Date: Wed, 07 Jan 2026 16:06:31 +0000

Is there any expectation or guarantee that `LargeObject` is thread safe?

Outside of a couple explicit things like closing connections, assumption should be that nothing is thread safe in the driver. This is an odd one though as the body of that function interacts via both fastpath and directly to the connection.

---

From: "davecramer (@davecramer)" <[email-masked]>
Date: Wed, 07 Jan 2026 16:08:16 +0000

> Is there any expectation or guarantee that `LargeObject` is thread safe?
No, but it's strange that the we keep status in there and that we don't guard the status.

I figure it doesn't hurt anything.