Welcome Guest, Not a member yet? Register   Sign In
No of open connections
#1

[eluser]kakawett[/eluser]
I was just wondering about the next syntax :

$this->load->database();

Does it create a connection or check that there's an open connection before creating a new one ?

If I simply past $this->load->database() at the begining of all of my functions, I won't get 2100 simultaneously open connections right ?
I'm pretty sure it's the case, I just wanna be sure.
#2

[eluser]smilie[/eluser]
As users manual says:

"Reconnecting / Keeping the Connection Alive

If the database server's idle timeout is exceeded while you're doing some heavy PHP lifting (processing an image, for instance), you should consider pinging the server by using the reconnect() method before sending further queries, which can gracefully keep the connection alive or re-establish it.

$this->db->reconnect();"

I would guess that it closes the connection once PHP is done...
Also in core folder, there is _close() function which closes MySQL connection.

And at the end, most MySQL servers (at least, by default) close connection after some idle time...

Cheers,
Smilie
#3

[eluser]kakawett[/eluser]
ow thanks, missed that part




Theme © iAndrew 2016 - Forum software by © MyBB