Assuming a class is annotated with @Service, does Spring guarantee a unique instance of the class for injection? Or should I put @Scope("singleton") on every service?
Asked
Active
Viewed 259 times
6
Maciej Ziarko
- 10,624
- 13
- 47
- 69
Jérôme Verstrynge
- 55,046
- 88
- 271
- 437
2 Answers
1
Here is a discussion I found on CodeRanch:
http://www.coderanch.com/t/586038/Spring/Spring-treat-Service-Singleton
And an answer from a different Stackoverflow post:
Community
- 1
- 1
Philip Tenn
- 5,815
- 8
- 46
- 79