dcsimg
Multiple users, Singleton class and XML DOM - Why this strange output!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Raja_Sarkar
Posted On:   Monday, October 14, 2002 04:18 PM

My application calls a configuration java file which in turn calls a FileUtility java file to read the file and then load the file content into the an XML DOM. The configuration file is a singleton class that has a docXML class variable that acts as the DOM structure. I am using two clients to call this singleton configuration class to see the effect of synchronization. I start the first client... it loads the DOM and traverses the tree... At this point I start the 2nd client.... To my amazement the first client does not crash ! Instead I get the intended values for both the clients. I cannot figure out why this happened. The configuration class being a singleton, its variable docXML should point to the same tree object for al   More>>

My application calls a configuration java file which in turn calls a FileUtility java file to read the file and then load the file content into the an XML DOM.

The configuration file is a singleton class that has a docXML class variable that acts as the DOM structure.

I am using two clients to call this singleton configuration class to see the effect of synchronization.

I start the first client... it loads the DOM and traverses the tree... At this point I start the 2nd client.... To my amazement the first client does not crash ! Instead I get the intended values for both the clients. I cannot figure out why this happened. The configuration class being a singleton, its variable docXML should point to the same tree object for all the clients that call it. So when the 2nd clint called the goToRoot() to point to the root node why didnt the first client lose its current focus and crash ? If anyone could clarify this it will be really helpful

Regards
Raj

   <<Less

Re: Multiple users, Singleton class and XML DOM - Why this strange output!

Posted By:   Roseanne_Zhang  
Posted On:   Tuesday, October 15, 2002 07:57 PM

Without knowing the specifics, it is very hard to tell what is going on in your code. Pretty interesting for sure.
About | Sitemap | Contact