Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Spring mongoTemplate thread safe?

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?

like image 432
Mahdi Avatar asked Apr 28 '15 07:04

Mahdi


1 Answers

As per spring docs.

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

For more details see section 5.4

like image 199
sol4me Avatar answered Oct 01 '22 10:10

sol4me