开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜