I use the cakePHP framework I have a question about how models handle MySQL query connections. Basically I have a model which I need to set recursive level of 2, to get to some information in a deeper model. Although I have removed all binding of level 2 models which I do not need the framework is still executing a large number of queries to build the result set.
What I want to know is if the framework opens and closes a MySQL connection for every query or does it open a single connection and executes all the queries and then close the connection?
Thanks
It seems to me that CakePHP connect to the database and then executes all queries. Look here for the code: https://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/Datasource/Database/Mysql.php