Singleton and EJB

Discussions

EJB design: Singleton and EJB

  1. Singleton and EJB (2 messages)

    So what are the rules regarding Singleton pattern in EJB? Is it or is it not legal to have a separate Singleton object being accessed by various beans in the server?

    For example, let's say I wanted a share pool for a Flyweight object or something like that. OK or no?

    Threaded Messages (2)

  2. Singleton and EJB[ Go to top ]


    go to inprise application server news group and search for singleton in subject, you will find several threads discussing about Singleton Pattern and how to implement it.

    News group is: inprise.public.appserver

    I hope it helps.

    Thx.
  3. Singleton and EJB[ Go to top ]

    You should always be aware that your beans could run in a clustered environment, involving several servers and thus several VMs. The way singletons are usually implemented in Java only ensure that there is one single instance per VM, which I guess is not what you want to have.
    So, if you really need a singleton (which is not always a good solution, for performance reasons), you should implement it using standard RMI or CORBA.

    JB.