Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubts in Clustered server environment

 
Murali Pachiyappan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 66
Java Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Murali Pachiyappan
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 66
Java Linux VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic