apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dubov <oa...@yahoo.com>
Subject Re: [PATCH]: improved error reporting for apr_dbd_mysql.c (and question)
Date Fri, 19 May 2006 01:54:47 GMT
1. At present you have 0 meaning "no-error" and some
arbitrary non informative integer meaning "error, but
I don't know what really happened". Most application,
therefore, can do no useful action on error - at most
they can retry the whole thing from the beginning. Of
course, you have a backend specific "apr_dbd_error" to
get a backend specific error code. So, to do anything
useful you must do something like:
if(apr_dbd_pvselect(...)) {
  err_code = apr_dbd_error();
  ... backend specific stuff for err_code
}
Now, explain me how it is different from my way:
if((err_code = apr_dbd_pvselect(...)) {
  ... backend specific stuff for err_code
}
(apart from obvious reduction of garbling in already
boring and garbled database access code).

2. The problem with mysqld: say you access some db
linked page for first time - apr-dbd opens connection
to mysqld and all work fine. Say, 8 hours passed and
nobody touched any db linked page on the server
(development server after night). Mysqld already
dropped the connection, yet apr-dbd thinks that
connection still exists and fails with stupid error
until the apache is restarted.


--- Bojan Smojver <bojan@rexursive.com> wrote:

> On Thu, 2006-05-18 at 01:27 -0700, Alex Dubov wrote:
> 
> > Attached patch makes apr_dbd_mysql to always
> return
> > internal xxx_errno codes of mysql instead of
> arbitrary
> > integers.
> 
> We should be returning APR error codes throughout
> DBD drivers, IMHO. The
> API user may not have access to interpretation of
> MySQL (and other)
> database specific error codes. Current behaviour is
> suboptimal, though.
> 
> > Question:
> > After period of inactivity, mysqld will close
> > connection to the server. I found no way to resume
> the
> > connection apart of restarting the server. I'm
> going
> > to look into this later, but may be somebody knows
> how
> > to deal with the situation?
> 
> Isn't mysqld the server? I'm guessing you mean mysql
> client closes the
> connection to mysqld, right? I can have a look at
> this on my setup, but
> I haven't noticed any disconnections in my testing
> (MySQL 5.0).
> 
> -- 
> Bojan
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Mime
View raw message