No - make a private static variable that is a pointer to your object type. Make sure it's NULL initially. Then at each request, check if this pointer is NULL - if it is, then no instance of your object has been initialized, so construct one and return it. If it is non-NULL, just return it:
Not quite. That's just hoping your constructor only gets called once.
I want to create an abstract factory template which will allow me to pass in an "ID" for a subclass and return the singleton instance of that class stored in the factory. It'd be easy to adapt for "multi-ton", but for its present use this isn't necessary.
The requirements are:
- I don't want... (2 Replies)
Medel : 9117-MMC
OS: AIX 6.1
Patch level : 6100-07-04-1216
Hacmp version : HACMP v 6.1.0.8
Oracle : 11.2.0.3 RAC
Node : 2 node
Dear, my one node server has been restarted early this morning, So, i tried to start HA and Oracle database.
after that, the follow error appears at the node... (1 Reply)