Spring mongoTemplate线程安全吗? [英] Is Spring mongoTemplate thread safe?
本文介绍了Spring mongoTemplate线程安全吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我定义了这个Bean:
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>
并使用此Bean实例化 mongoOprations
,现在我想知道是春天 mongoTemplate
线程安全?
and i instantiate a mongoOprations
using this Bean, now i want To know Is Spring mongoTemplate
thread safe?
推荐答案
按照春季文档。
配置完成后,MongoTemplate是线程安全的,可以跨
多个实例重复使用。
Once configured, MongoTemplate is thread-safe and can be reused across multiple instances.
有关详细信息,请参阅 5.4
For more details see section 5.4
这篇关于Spring mongoTemplate线程安全吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文