pgjdbc/pgjdbc GitHub issues and pull requests (mirror)
help / color / mirror / Atom feed[pgjdbc/pgjdbc] issue #3938: Documentation is conflicting if the drier is thread safe.
2+ messages / 2 participants
[nested] [flat]
* [pgjdbc/pgjdbc] issue #3938: Documentation is conflicting if the drier is thread safe.
@ 2026-02-12 11:37 "strelec (@strelec)" <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: strelec (@strelec) @ 2026-02-12 11:37 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
Here it says that it is okay to reuse the connection from multiple thread, as long as you create a new Statement in every thread: https://jdbc.postgresql.org/documentation/query/
This was my experience as well, I was using it in this manner and never got any data corruption or exceptions.
> If you are using threads, and several are using the database, you must use a separate Statement for each thread. Refer to [Using the Driver in a Multithreaded or a Servlet Environment](https://jdbc.postgresql.org/documentation/thread/) if you are thinking of using threads, as it covers some important points.
Then on the provided link it says the drier is not thread safe at all, and it does not cover any important points as it was promised: https://jdbc.postgresql.org/documentation/thread/
Which is it?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: [pgjdbc/pgjdbc] issue #3938: Documentation is conflicting if the drier is thread safe.
@ 2026-02-12 11:57 "davecramer (@davecramer)" <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: davecramer (@davecramer) @ 2026-02-12 11:57 UTC (permalink / raw)
To: pgjdbc/pgjdbc <[email protected]>
Well in general since PostgreSQL is not threaded the driver is not thread-safe.
Each connection should have it's own thread.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2026-02-12 11:57 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-02-12 11:37 [pgjdbc/pgjdbc] issue #3938: Documentation is conflicting if the drier is thread safe. "strelec (@strelec)" <[email protected]>
2026-02-12 11:57 Re: [pgjdbc/pgjdbc] issue #3938: Documentation is conflicting if the drier is thread safe. "davecramer (@davecramer)" <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox