• 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

Implementing Singleton in clustered environment

 
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, I am not sure if I am posting my query in the correct forum.
If I need to change to a different forum, please let me know and I shall do the same.

How do we implement a singleton design pattern in a clustered environment?
This was an interview question for which I did not have an answer.
I understand singleton design pattern and the double checked locking as well.
Could someone explain me how we could implement Singleton in a clustered environment?

Regards,
Sriraam
 
Bartender
Posts: 4179
22
IntelliJ IDE Python Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think you can, (different JVMs means impossible to share same instance). And I think it would be a waste of time to try. Instead, you need to understand what requirement led to the 'need' for Singleton, then try to match that requirement rather than match the implementation. Read WhatNotHow as it pertains to this very nicely.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Check the below Link

http://www.techspot.co.in/2009/07/singleton-in-cluster.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic