aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Doubts in Clustered server environment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Doubts in Clustered server environment" Watch "Doubts in Clustered server environment" New topic
Author

Doubts in Clustered server environment

Murali Pachiyappan
Greenhorn

Joined: Apr 18, 2012
Posts: 4

1. In Clustered server environment how we can use Singleton object

2. In clustered server environment how we can use static variable

3. In clustered server environment how we can avoid duplicate responses



please provide answer so that it can be usefull for me.
Prabaharan Gopalan
Ranch Hand

Joined: Oct 16, 2009
Posts: 66

Have you tried this link: https://www.google.co.in/search?q=singleton+in+clustered+environment

If you did, let us know what exactly you didn't understand and we'll try to explain. You might want to check out ShowSomeEffort


Googling doesn't make you a genius. But not Googling makes you dumber.
Murali Pachiyappan
Greenhorn

Joined: Apr 18, 2012
Posts: 4
hi Prabaharan, thanks for the reply. Yes i have tried and in my knowledge i got the follwing answer,
1) In Clustered server environment how we can use Singleton object i got follwoing answer.
a. we can go for table or file system to serialize and deserialize the object(which needs to be singletoned)
where file or table is common to all clusters.
b. we can deploy an ejb in an cluster(which is going to be used by all clusters which needs singleton) and using RMI invocation
we can give single object to all clusters using standard singleton way.
c. we can use distributed memory object caching system.

i have tried JNDI but i got the performance problem. Because the admin servers has to send the JNDI data to all servers
periodically.i mean the load balancer. May be distributed memory object caching system like oracle coherence,jboss infinispan is good,
but i don't know excatly because not yet to tried.

2) In clustered server environment how we can use static variable.
Static variables are obviously scoped to the JVM they're living in. So, in a clustered environment, if you change one, the other JVMs are not going to know about the change.we can not assure static variable created only one copy per JVM. Because Static variables are scoped to the class in which they are defined. So, if a class is loaded by more than one classloader within the same JVM then there will be multiple copies of the static variable within the same JVM. Because
classes are not equal unless they are loaded by the same classloader... i don't know the solutions yet.

My application needs to share a state among many objects, so i store the state in a static variable. Rare case i got problem in clustred env. si i migrating the state to the database... but i don't know the correct solution.


3) In clustered server environment how we can avoid duplicate responses
In my knowledge i don't know the answer..

Please correct me if anything is missing.

Prabaharan Gopalan
Ranch Hand

Joined: Oct 16, 2009
Posts: 66

I am not sure if you missed anything. Did you find what you're looking for?

As to the duplicate responses - what is the 'response' you're talking about? are we talking about HTTP request/response?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubts in Clustered server environment