[eluser]Colin Williams[/eluser]
CI will open a connection right after the Controller is instantiated if the database class is autoloaded, or when the load->database() method is called, or when a model is called and instructed to load the database. CI closes any open connection just before exiting.