I am calling Db::getInstance()->execute() for insert and update and for selection query Db::getInstance()->executeS() After this do we need to close the database conenction or prestashop itself closes /handles the database connection .
how will we check whether a connection is open for a longtime for our database in prestahsop? Our server admin says our database sessions are getting increased since we are not closing the connection .
Any expert prestahsop can you explain how PrestaShop closes the connection or do we need to close it manually ?
Db::getInstance()->execute()
For certain cronjob files that we created ,what we do is we include the config file as shown below: require 'config/config.inc.php';
$db = Db::getInstance();
$result = $db->executeS($get_promotions_sql, false);
while ($row = $db->nextRow($result)) {
$id_product=$row['id_product'];
$name="<br>".$row['name'];
}
does this make my database connection open for ever? or will it be closed/or handle by getInstance function in prestashop