General J2EE: Singleton Object in clustered environment

  1. Singleton Object in clustered environment (2 messages)

    Is there any best pratice for implementing a singleton object in the clustered environment ?

    Threaded Messages (2)

  2. singleton[ Go to top ]

    It is not recomended to use singleton when you have shared information, example: session information.
  3. There are several ways to have something act like a singleton - all of them are based on central storage or replicated data.

    A few ideas - all of them with huge implications to your application design:

    - Use a DB to store your data.
    - Use a SFSB (not recommed).
    - Use local singletons with synchronisation in background via JMS/RMI ...
    - Use JNDI (Serialized Objects or ResourceFactories or equal)