Tagged with: PSC share LSE OTA OBA how a prototype batch
1. Scope1.1 and Theory of bean
Scope describes how the spring container creates an instance of a new bean, which can be implemented by @scope annotations
- Singleton: Default configuration, a spring container has only one instance of the bean, and the whole container shares an instance.
- Prototype: Creates a new bean instance each time it is called.
- Request:web project, create a new bean instance for each HTTP request.
- Session:web project, create a new bean instance for each HTTP request.
- Globalsession: This is intended to be useful in protal applications, to create a new bean instance for each global HTTP session.
In addition, there is one scope in spring batch that uses @stepscope, and we will introduce this scope in the batch section.
Spring Common configuration (1) Scope of---bean