• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Same bean multiple definition how many instances?

 
Ranch Hand
Posts: 40
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Guys...I found something new (probably because I never saw anything like this before ) and was googling for some explanation without any luck.



How many instances of Student bean gets created ? I thought probably a singleton bean will eventually get created, irrespective of the number of definition for all the same type of beans, spring container would return the same singleton instance. But, I guess ApplicationContext is creating a singleton instance per bean definition in the spring container instead of a singleton instance per container? Am I doing something wrong?
 
Ranch Hand
Posts: 954
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ApplicationContext creates an instance of beans per container if scope is singleton. It is also default scope.
 
Shouvik Bhattacharya
Ranch Hand
Posts: 40
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tushar Goel wrote:ApplicationContext creates an instance of beans per container if scope is singleton. It is also default scope.



I am aware of this however this is not exactly what I am looking for
reply
    Bookmark Topic Watch Topic
  • New Topic