• 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CI_DB_driver Bug?

#11
(02-10-2015, 09:03 PM)InsiteFX Wrote: Did you try using:

PHP Code:
$this->db->reconnect(); 

Yes i did, i have already mentioned in my previous post that i'm reconnecting again in my model's constructors, i also did try using reconnect in my controller's constructor but the issue is still there, as you can see from Backtrace that warning is being generated from the constructor of the main controller.
Reply

#12
Help anyone here!!! Sad
Reply

#13
Quoting the MySQL manual that was already linked in this thread:

Quote:By default, the server closes the connection after eight hours if nothing has happened.

Given that you're using a persistent connection, and you haven't got much traffic on the website ... it probably just times out when nobody visits your site for 8+ hours. Try setting pconnect to FALSE.
Reply

#14
(02-11-2015, 06:36 AM)Narf Wrote: Quoting the MySQL manual that was already linked in this thread:


Quote:By default, the server closes the connection after eight hours if nothing has happened.

Given that you're using a persistent connection, and you haven't got much traffic on the website ... it probably just times out when nobody visits your site for 8+ hours. Try setting pconnect to FALSE.

Right now i m on dev local system, which is windows 8.1 and wamp configured. but i keep constantly getting this warning, even several times in an hours, and sometimes i even get these on multiple consecutive page refreshes, after couple of hits it goes away. how can i suppress it, turning pconnect false increases my pages load-time.
Reply

#15
Again, quoting that same manual:

Quote: You are using a Windows client and the server had dropped the connection (probably because wait_timeout expired) before the command was issued.

The problem on Windows is that in some cases MySQL does not get an error from the OS when writing to the TCP/IP connection to the server, but instead gets the error when trying to read the answer from the connection.

... you should've really read it yourself.

A persistent connection may decrease your page load time on your local setup, but that's because it's only you using the application. When deployed on production, with pconnect set to TRUE, each time you have more than 1 visitor at a time, the second (and third, fourth, etc.) will have to wait for the first person's request to be fulfilled before they can load a page.

pconnect is not a magic "improve my performance" switch. It has a specific purpose and comes with certain implications that are now the reason for your issue. Just turn it off.
Reply

#16
Y
(02-11-2015, 07:14 AM)Narf Wrote: Again, quoting that same manual:

Quote: You are using a Windows client and the server had dropped the connection (probably because wait_timeout expired) before the command was issued.

The problem on Windows is that in some cases MySQL does not get an error from the OS when writing to the TCP/IP connection to the server, but instead gets the error when trying to read the answer from the connection.

... you should've really read it yourself.

A persistent connection may decrease your page load time on your local setup, but that's because it's only you using the application. When deployed on production, with pconnect set to TRUE, each time you have more than 1 visitor at a time, the second (and third, fourth, etc.) will have to wait for the first person's request to be fulfilled before they can load a page.

pconnect is not a magic "improve my performance" switch. It has a specific purpose and comes with certain implications that are now the reason for your issue. Just turn it off.

You still just explained alternatives to the solution, the thing is, OK on production i'll disable pconnect and there wont be any queuing for visitor's queries. but on local i do need the speed for my work to be fast and i want to keep pconnect true, but i just don't want to see this damn warning, coz it does nothing and has no implications on my code, its a codeigniter behavior and there should be a way to suppress only this warning and not all the warning level notices. its like telling this warning that "Thanks for notifying but don't remind me again, because you are damn irritating. :\"
Reply

#17
(02-11-2015, 11:33 AM)summer Wrote: You still just explained alternatives to the solution

I didn't explain "alternatives". I gave you the solution and explained why it is such.

(02-11-2015, 11:33 AM)summer Wrote: the thing is, OK on production i'll disable pconnect and there wont be any queuing for visitor's queries. but on local i do need the speed for my work to be fast and i want to keep pconnect true

You need the speed? How much is the difference between using a persistent connection and a regular one?
Unless you're using a remote database (which in the case of WAMP is most likely not), the difference shouldn't be noticeable, let alone significant.

(02-11-2015, 11:33 AM)summer Wrote: but i just don't want to see this damn warning, coz it does nothing and has no implications on my code

You want to ignore a problem ... I'm not helping you with that.

(02-11-2015, 11:33 AM)summer Wrote: its a codeigniter behavior

No, it's a MySQL behavior. It has nothing to do with CodeIgniter.

(02-11-2015, 11:33 AM)summer Wrote: and there should be a way to suppress only this warning and not all the warning level notices. its like telling this warning that "Thanks for notifying but don't remind me again, because you are damn irritating. :\"

This may sound condescending, but ... programming doesn't work that way.
Reply

#18
(02-11-2015, 11:41 AM)Narf Wrote:
(02-11-2015, 11:33 AM)summer Wrote: You still just explained alternatives to the solution

I didn't explain "alternatives". I gave you the solution and explained why it is such.

... or, well, I gave you a possible solution.

As I said, it's a MySQL problem. So updaing the MySQL server configuration might as well be the solution.
Reply

#19
(02-11-2015, 11:41 AM)Narf Wrote: I didn't explain "alternatives". I gave you the solution and explained why it is such.
Ok, but you didn't give solution for suppressing the warning message.

(02-11-2015, 11:41 AM)Narf Wrote: You need the speed? How much is the difference between using a persistent connection and a regular one?
Unless you're using a remote database (which in the case of WAMP is most likely not), the difference shouldn't be noticeable, let alone significant.
bro, when i'm saying there is a difference then there is, let me explain, with pconnect true, page loading on chrome tab doesn't even show, but with off, it takes that much time to hold a click or two back. thats enough difference for me.

(02-11-2015, 11:41 AM)Narf Wrote: You want to ignore a problem ... I'm not helping you with that.
I m not ignoring the problem, i just don't want to see the warning about it. its not even a problem. there is no impact on my code or dynamic data which is coming from database, it just messes with my view loading on top of each page. thats it. thats why i don't want to see it.

(02-11-2015, 11:41 AM)Narf Wrote: No, it's a MySQL behavior. It has nothing to do with CodeIgniter.
I know its a MySQL behavior but Codeigniter is the one thats showing the warning message. there should be a way to handle it through CI.

(02-11-2015, 11:41 AM)Narf Wrote: This may sound condescending, but ... programming doesn't work that way.
Programming is making it work all the ways. p.s the thing you saying about server_timeout, the warning it is so random, it doesn't even concerns that. it comes even after few seconds and even on multiple consecutive page refreshes. then suddenly it goes away and doesn't come for hours. i think the damn thing is broken, someone needs to look into that.

p.s autoloading database in CI should mean really autoloading the database driver not keep pouting about that server timed_out. or there should be a way to fix it through CI.
Reply

#20
You can rant all day long, but that's not going to change how things work ... If you don't want to take my advice, that's fine with me.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.