Thread-safety documentation

Douglas Surber douglas.surber at oracle.com
Tue Oct 10 14:11:36 UTC 2017


Good point. I’ll work on adding that. 

As a first cut, DataSource, DataSourceFactory, Transaction, and ConnectionProperty have to be thread safe. Connection, Result, Submission, and all the Operations do not have to be thread safe. The remaining stuff is static and so is thread safe.

Douglas

> On Oct 10, 2017, at 1:42 AM, Philippe Marschall <pm at netcetera.ch> wrote:
> 
> Hello
> 
> One of the issues I have with the current JDBC specification is it's approach to thread-safety documentation or rather lack thereof. This leads to repeated discussions, see [1].
> 
> It would like to see the new API improving in this area by clearly specifying which objects are thread-safe and which ones aren't. An obvious candidate for thread-safety would be DataSource.
> 
> The only reference to thread-safety I could currently find is:
> 
> Results are not required to be thread-safe.
> 
> But this affects more or less every class, eg. Transaction.
> 
> [1] https://github.com/pgjdbc/pgjdbc/issues/921
> 
> Cheers
> Philippe



More information about the jdbc-spec-discuss mailing list