Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Singleton Pattern in distributed System

 
Abdul Kader
Ranch Hand
Posts: 115
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like to know how we can make sure a class must have only one object in a distributed System. (I.e. how can we apply singleton patterns which two or more JVM)
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This can be difficult and can probably best be done by some proprietary application server feature. For instance, the app server may be able to pin the singleton to a specific server instance in the cluster.

A better question would be: What are you trying to achieve?
 
Srilakshmi Vara
Ranch Hand
Posts: 169
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Implementing Singleton Pattern in distributed environment has the following issues to address.

1. Ensures Single object per JVM. If you have multiple JVMs need to address it programmatically.
2. Implement Doouble checked locking in your program.
 
Uday Patel
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why am I not surprised that Singleton has been identified as Anti-pattern.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic