Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How does event listener work in java?

867


Enlist the technologies embraced in j2ee?

868


What is setfocusable in java?

1054


Is string a primitive data type in java?

859


What is component contract?

894


What is a plugin in java?

865


Explain connector architecture.

935


What is main method in java?

1019


What is j2ee technology?

905


What is document?

970


What is java mobile?

914


What are the advantages in the use of spring for application development?

879


What are web technologies in java?

808


What is j2ee and j2se?

894


How can I be good in java?

904