Domanda di colloquio di Route1

Spring beans are thread safe?

Risposta di colloquio

Anonimo

10 giu 2018

Spring framework does not do anything under the hood concerning the multi-threaded behavior of a singleton bean. It is the developer's responsibility to deal with concurrency issue and thread safety of the singleton bean. While practically, most spring beans have no mutable state, and as such are trivially thread safe.