[eluser]kadishmal[/eluser]
I don't know what is the statistics of how many users use persistent connection in CI or how many use non-persistent dbconnect(), but I wonder why would user want to create a NEW connection every time dbconnect() is called?
The dbconnect() function has the following code:
Code:
public function db_connect()
{
return @mysql_connect($this->hostname, $this->username, $this->password, TRUE);
}
TRUE parameter at the end forces the database driver to establish a new connection even if the parameters are the same with already opened connection.
I can think of one situation when a user would actually want to establish a new connection. It is when user wants to execute certain operations in parallel using asynchronous queries. Other than that.... user would probably want to reuse the open connection.
I tried to look the entire history of changes for
mysql_driver.php file, but didn't have patience further than the 3rd page. Would anyone please explain me the background of "forcing a new connection"?
The reason I am asking is because I am updating the CUBRID Database driver for CI and I wonder why there is such a code.
Thank you in advance.