Right now my project website starts a connection with the database as the website is loaded. I have pages on the website where a connection to a database isn't required.
Is it resourceful to maintain a connection to the database for the entire duration of a session, or keep remaking connections when an event occurs that actually requires a connection? (Such as registering an account)