Db links point to the same db if pconnect == TRUE |
[eluser]SeasonedCoder[/eluser]
Is it known behavior that if you try to connect to two different databases both links refer to the same database (second one) if pconnect is set to TRUE in database configuration section? Or is it something wrong with my configuration? Once I set pconnect to FALSE everything works like a charm. If I go back to TRUE -- both links end up pointing to the same database -- that's why I decided to raise this question.
[eluser]xwero[/eluser]
It's perfectly logical. A persistent database connection is like a horse with eyeflaps, or whatever you call those things. It will look only look ahead, disregarding all the traffic next to him. The database will only look for that connection even if the script wants to create another connection.
[eluser]NogDog[/eluser]
Personally, I always set pconnect to false. There are a bunch of possible issues that can arise from using persistent database connections, and the vast majority of the time the potential gain does not outweigh the potential risks, as far as I'm concerned. See http://www.php.net/persistent-connections for more info. (In fact, I'd like to see the default setting delivered with CI be changed to "false".)
[eluser]SeasonedCoder[/eluser]
Thanks for the explanation. Personally, I don't mind using non-persistent ones. |
Welcome Guest, Not a member yet? Register Sign In |