Is Spring mongoTemplate thread safe?

孤者浪人 提交于 2019-12-07 12:49:57

问题


I define this Bean:

<bean id="mongoTemplate" class="org.springframework.data.mongodb.core.MongoTemplate">
    <constructor-arg name="mongoDbFactory" ref="mongoDbFactory" />
    <constructor-arg name="mongoConverter" ref="mongoConverter" />
</bean>  

and i instantiate a mongoOprations using this Bean, now i want To know Is Spring mongoTemplate thread safe?


回答1:


As per spring docs.

Once configured, MongoTemplate is thread-safe and can be reused across multiple instances.

For more details see section 5.4



来源:https://stackoverflow.com/questions/29913211/is-spring-mongotemplate-thread-safe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!