Does every time I new an new BeanFactory the beans in the XML file are to be recreated? In other words, if I set an bean’s scope to Singleton, I got the same Object even if I newed another BeanFactory?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Summary: yes, for one
BeanFactory, no, for creating aBeanFactoryeach time.If you use
scope="singleton", which is the default setting, you will get the same instance each time from the sameBeanFactory.Spring does not manage scope across multiple, unrelated, BeanFactory instances.
Why you would create multiple bean factories?