开发者

org.springframework.jdbc.datasource.DriverManagerD ataSource is it threadsafe?

开发者 https://www.devze.com 2023-02-11 08:28 出处:网络
We would like to know whether the following data source org.springframework.jdbc.datasource开发者_开发问答.DriverManagerD ataSource

We would like to know whether the following data source

org.springframework.jdbc.datasource开发者_开发问答.DriverManagerD ataSource

is threadsafe and can be used in production environment? Any links to a source that confirms it would be helpful.

regards aravias


No, you can not use DriverManagerDataSource in production. Not because it is not thread safe (I believe it is), but because it does not perform any connection pooling, which results in horrible performance and unnecessary network overhead. See notes in Javadoc.

You should consider using DBCP or C3P0 data sources, DriverManagerDataSource is fine only for testing purposes.

0

精彩评论

暂无评论...
验证码 换一张
取 消