tag:blogger.com,1999:blog-35897879.post7960138367945130450..comments2023-11-02T21:16:09.308+11:00Comments on Java-Success Blog: Tutorial: Understanding Spring scopes -- Singleton Vs Prototype Anonymoushttp://www.blogger.com/profile/00869496028596976417noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-35897879.post-35582864534674621962014-03-25T23:42:51.918+11:002014-03-25T23:42:51.918+11:00DAO gets injected into Service. There is only a si...DAO gets injected into Service. There is only a single instance of service, which takes a single instance of DAO when initialized. When you have Service as prototype, each thread will have its own instance, and same DAO gets injected into each new instance of service.Anonymoushttps://www.blogger.com/profile/00869496028596976417noreply@blogger.comtag:blogger.com,1999:blog-35897879.post-1521888434053218012014-03-25T22:44:56.018+11:002014-03-25T22:44:56.018+11:00Hi Sir,
In the above example when the DAO is made...Hi Sir,<br /><br />In the above example when the DAO is made prototype but the service is singleton why only one instance of the DAO bean is created but on the other hand when you make the service as prototype multiple instances of services are created on running the main.Vikram Jadahttps://www.blogger.com/profile/06501286026076645649noreply@blogger.com