is it possible to create single instance of java class per
session in web application
Answer Posted / savar33
Hi guys
the singleton solution will not work, since several nodes
are possible in the cluster, each node has it's own java.
Those singleton can be instanciated in each class.
Beside this the presented implementation of singleton design
pattern is improper. You should override constructor in this
way :
private Singleton(){};
I also would make getInstance() method synchronized. This is
multithreaded environment.
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
I am newbie in J2EE & looking for strong basic behind each concept as, Why do we use private access specifier before each variable of type property bcoz ultimately to access it outside the class we use public method as getter & setter ? If we use getter & setter to access it outside the class so better we make variable as public so that it is easily available outside of the class... Please guide me why do we use as private ????
What is general entity?
Why is java robust?
What is jaxr client?
What are struts?
What is a panel java?
Which framework is best for java?
How to invoke stored procedure in hibernate?
Why is j2ee needed?
What is ebxml?
What are the advanced technologies in java?
Is java procedural or object oriented?
What is a java ee container?
What is element?
What do you understand by connector? Explain connector architecture.