• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Doubts in Clustered server environment

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 66
VI Editor Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
VI Editor Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
reply
    Bookmark Topic Watch Topic
  • New Topic