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
How does event listener work in java?
Enlist the technologies embraced in j2ee?
What is setfocusable in java?
Is string a primitive data type in java?
What is component contract?
What is a plugin in java?
Explain connector architecture.
What is main method in java?
What is j2ee technology?
What is document?
What is java mobile?
What are the advantages in the use of spring for application development?
What are web technologies in java?
What is j2ee and j2se?
How can I be good in java?