Varadhan Sesharaman wrote:Some gave an example of creating singleton Connection object is more effcient.
Singleton is not more efficient. Using
one single Connection object for a long time instead of creating new ones that are short-lived and then created a new for every DB action can be more efficient, in the same way that it's more efficient to make one phone call to your friend and say, "Let's meet at 8:00," than to make 4 phone calls, saying, "Let's", and "meet" and "at" and "8:00."
But Singleton doesn't inherently have anything to do with that, nor does its lack.