Welcome Guest, Not a member yet? Register   Sign In
"Random" database connection errors
#1

[eluser]arvid.janson[/eluser]
Ok, so I've built a couple of CodeIgniter apps, which are working quite well most of the time. However, from time to time I keep getting

"A Database Error Occurred
Unable to connect to your database server using the provided settings.

Filename: core/Loader.php

Line Number: 232
"

when I try navigate around the page (different apps, and different hosts).

It doesn't occur all the time, so the DB-settings ARE correct. Judging from the seemingly "random" appearance of this error, I keep getting the feeling that this is somehow related to the number of connected users.

I've disabled the "Persistent connections" setting, which seemed to help, but did not eliminate the problem completely.

So, my questions are:
* is it possible to write (faulty) code that does not close the DB-connection after the script is completed?
* can I test this somehow, to see if connections not closing is actually the case?

I'm on a shared host, but the site is not yet launched, so traffic is minimal. I guess it could be the host after all, but it feels like something may be going on with my code...

Any tips? Any thing I should be looking out for?

I would be happy to post any relevant code, but at the moment I don't know what that should be...


Thanks a bunch!
#2

[eluser]InsiteFX[/eluser]
Set application/config/database.php pconnet to FALSE
#3

[eluser]arvid.janson[/eluser]
Thank you InsiteFX, but as I wrote in the post above (although not that clear) I've already tried this.
#4

[eluser]Marcela Garcia[/eluser]
thanks
#5

[eluser]Marcela Garcia[/eluser]
pconnet change to false solved my problem, but would like to know when making transactions affecting the database, or repercussions will this have?




Theme © iAndrew 2016 - Forum software by © MyBB