Ok, lets say i have many objects on a page, and these objects access tables in a database. Would it be better to have each object open and close its own connection, or would it be better to create 1 connection at the start of the page, and pass that connection to all the objects that need it. And disconnect at the end of the entire script.
I'm not sure what i mean by better myself, but im thinking that the less connections to open, the faster the page would load. But i also think that if a page is hogging a connection for the whole time, won't there be less connections for other pages to use?
I debated this in my head all night while lieing in bed, and i dont know which is "better". What do you guys think?