Spring Framework MVC "concurrency"?

AFAIK, Spring beans (version 3 and above), if not specified, all are single. So, my concern is, for example, when using @Repository (in classes that access database resources) or @Service (in classes that perform validation and business logic) will these objects be available to all users of the application if accessed simultaneously?

Thanks in advance...

+4
source share
1 answer

Yes, these facilities will be available at the same time. Therefore, they must be encoded in a thread-safe manner. But this is trivial, as they are usually stateless, with the exception of their dependencies, which are introduced during the launch of Spring.

+5
source

Source: https://habr.com/ru/post/1479071/


All Articles