CodeIgniter Forums
SOLVED! - Codeigniter doesn't seems to close database connection?? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: SOLVED! - Codeigniter doesn't seems to close database connection?? (/showthread.php?tid=20874)



SOLVED! - Codeigniter doesn't seems to close database connection?? - El Forum - 07-24-2009

[eluser]sudesh[/eluser]
I was checking the number of active connections my database was having, saw that all applications using CI has connection and were in sleep (given i was just checking my developer set up, there should be max 1 - given i was the only one using it).

I believe having lot of active connection would hamper my database(I m no expert on it).

Is there a way(or some config setting that i missed) to close connections after the page is completely rendered.


SOLVED! - Codeigniter doesn't seems to close database connection?? - El Forum - 07-24-2009

[eluser]Twisted1919[/eluser]
In application/config/database.php find :
Code:
$db['default']['pconnect'] = TRUE;
and set it to
Code:
$db['default']['pconnect'] = FALSE;



SOLVED! - Codeigniter doesn't seems to close database connection?? - El Forum - 07-24-2009

[eluser]sudesh[/eluser]
[quote author="Twisted1919" date="1248450346"]In application/config/database.php find :
Code:
$db['default']['pconnect'] = TRUE;
and set it to
Code:
$db['default']['pconnect'] = FALSE;
[/quote]

thx twisted,

it worked. I needed one more thing.

which connection type to use persistent connect or connect(which is more efficient).


SOLVED! - Codeigniter doesn't seems to close database connection?? - El Forum - 09-25-2009

[eluser]_Dannoso_[/eluser]
Thanks thanks thanks!
A night spent to fix why forked process collided eachother in db queries even with a new-spanned connection!
And you've solved my problem in 2 seconds!!

Simpler is better!