In spring mvc in my all dao implantation classes set scope is singleton="false". Is it correct approach or not? If it is correct ...When we need to set to all daos are set to singleton="true"?
Please clarify the same.
Well singleton="true" is a Spring 1.x xml configuration. In Spring 2.x and above there is a scope="" to change the scope from Singleton to any other scope. But as far as DAO/Repositories, they shouldn't be holding any state, therefore being a stateless object and best as a Singleton, since you only need one instance to handle all your users. Many threads can call the same method at the same time in a single instance without any issues. It is only when you hold state that you have to think of Threading issues.