On Thu, 14 Dec 2000, Tim Bunce wrote:

> On Thu, Dec 14, 2000 at 11:47:58AM +1100, Jie Gao wrote:
> > On Thu, 14 Dec 2000, Stas Bekman wrote:
> > 
> > > I think that this item from the guide is not relevant anymore. Can I
> > > kill it? 
> > > 
> > > =head3 The Morning Bug
> > > 
> > > Relational database server keeps a connection to the client open for a
> > > limited period of time. Many developers were bitten by so called
> > > B<Morning bug>, when every morning the first users to use the site
> > > received a C<No Data Returned> message, but after that everything
> > > worked fine. The error is caused by C<Apache::DBI> returning a handle
> > > of the invalid connection (the server closed it because of a timeout),
> > > and the script was dying on that error. The infamous C<ping()> method
> 
> Why is/was ping() infamous?
> 
> > > was introduced to solve this problem, but still people were being
> > > bitten by this problem. Another solution was found - to increase the
> > > timeout parameter when starting the SQL server. Currently I startup
> > > C<MySQL> server with a script C<safe_mysql>, so I have modified it to
> > > use this option:
> > > 
> > >   nohup $ledir/mysqld [snipped other options] -O wait_timeout=172800
> > > 
> > > (172800 seconds is equal to 48 hours. This change solves the problem.)
> > > 
> > > Note that as from version C<0.82>, C<Apache::DBI> implements ping()
> > > inside the C<eval> block.  This means that if the handle has timed out
> > > it should be reconnected automatically, and avoid the morning bug.
> > 
> > Problem is it is not only relevant, but ping doesn't work in all cases.
> > I have to cron-kill/start my servers in the morning.
> 
> With what database driver?
> 
> Some drivers don't support ping others might be buggy. It's not helpful
> to say "ping doesn't work in all cases" without qualifiying why and/or
> which drivers that applies to.

OK, fair enough. It's DBD::Sybase. I have posted the problem to dbi-users
and nobody had a solution to it.

Regards,


Jie

Reply via email to