• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 538
  • Last Modified:

How Could I make spring should be singletton

How Could I make spring should be singletton

is it singleton = true or false

is it correct
0
Manikandan Thiagarajan
Asked:
Manikandan Thiagarajan
1 Solution
 
RGRodgersCommented:
Your question is a little confusing, but check this out:

http://www.digizenstudio.com/blog/2006/09/14/a-spring-singleton-is-not-a-singleton/
0
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Spring beans are singletons by default, ie. no matter how many other beans reference a particular bean or how many lines of Java call .getBean() to a bean, there will only be ONE instance of that bean.

But they can be changed to return a new distinct instance for every reference or getBean() call by specifying scope="prototype" in the bean's definition.

Check out the documentation... http://static.springsource.org/spring/docs/current/spring-framework-reference/html/beans.html#beans-factory-scopes
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now