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

What is java actionlistener?

826


What is architecture neutral in java?

894


What is the ear file?

882


What is document root?

856


What is a jbutton in java?

890


Are java primitives objects?

863


What is application client?

931


What are container services?

882


What is j2ee stack?

851


What is japplet in java?

913


Which package is imported by default in java?

956


What is frame in java?

870


What is awt package in java?

862


Is java important for my computer?

827


What is jaxr client?

912