Per JDBC, this doesn’t just mean use of the Connection object itself. It means 
all objects that belong to that Connection. For example, you can have two 
Statement instances open in the same Connection at the same time, and 
ResultSets reading from those statements, but you cannot interact with those 
Statements or ResultSets from two different threads at the same time.

Yes, it’s rather restrictive. But if you don’t like it, open separate 
Connection instances.

> On Jan 27, 2026, at 10:05 AM, Felipe Oliveira Carvalho <[email protected]> 
> wrote:
> 
> Do you mean ADBC?
> 
> In general, yes, a Connection should be used from a single thread at-a-time
> in database APIs (ODBC/JDBC/ADBC...).
> 
> That is the case because a Connection represents a "session". Each
> statement can potentially change the internal session state that connection
> represents. If you have multiple threads alternating access to a
> connection, the end result becomes non-deterministic.
> 
> --
> Felipe
> 
> On Mon, Jan 26, 2026 at 10:47 PM Pedro Matias <[email protected]>
> wrote:
> 
>> Hello,
>> 
>> What thread-safety guarantees do we intend to provide for the JDBC driver?
>> 
>> My understanding is that, for example, a Connection is only safe to use
>> from a single thread. Is this the intended behavior across driver
>> interfaces, and is it documented anywhere? If not, I’m happy to help
>> document it.
>> 
>> Thanks,
>> Pedro Matias
>> 

Reply via email to