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?
-
Singleton and EJB (2 messages)
- Posted by: Kenneth Delong
- Posted on: July 27 2000 16:26 EDT
Threaded Messages (2)
- Singleton and EJB by Wap Inprise on July 27 2000 18:31 EDT
- Singleton and EJB by Jean-Baptiste Nizet on July 28 2000 05:45 EDT
-
Singleton and EJB[ Go to top ]
- Posted by: Wap Inprise
- Posted on: July 27 2000 18:31 EDT
- in response to Kenneth Delong
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.
-
Singleton and EJB[ Go to top ]
- Posted by: Jean-Baptiste Nizet
- Posted on: July 28 2000 05:45 EDT
- in response to Kenneth Delong
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.