Re: Re: PEAR::DB connection timeout
| From: | Justin Patrin | Date: | Mon, 15 Nov 2004 18:19:47 +0000 |
| Subject: | Re: Re: PEAR::DB connection timeout | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15525@lists.php.net to get a copy of this message | ||
On 15 Nov 2004 03:02:55 -0000, Matthew Weier O'Phinney
<matthew@garden.org> wrote:
> * Matthew Weier O'Phinney <matthew@garden.org>:
> <snip>
>
>
> > The code I'm testing does the following:
> >
> > 1) Inserts a record into a table using DB's autoExecute()
> > 2) Grabs that record's new ID (using the MySQL LAST_INSERT_ID()
> > function)
> > 3) If a certain array is set, prepare()s an INSERT statement, then loops
> > over the array, execute()ing the statement for each element.
> > 4) If another array is set, does the same as 3 for that array and table.
> >
> > (3 and 4 are to set elements in link tables for the newly created
> > record.)
> >
> > I built a set of tests for the API using SimpleTest, and everything
> > passes; new records are inserted fine, and all data is present.
> >
> > However, when I then make calls to the API from a web application...
> > step 4 fails, and I get "Connection timed out" from my DB connection.
> > I can take the SQL created (I log it, just in case :-) and run it on the
> > database without error. I can even run the sequence of statements
> > directly on the database without error or any sort of time lapse.
> >
> <snip>
> >
> > What I see when monitoring it is that after the initial queries are
> > passed to the database, but the connection suddenly enters sleep mode
> > until the connection times out. What I can't figure out is why it's
> > doing so.
>
> Okay, hate to followup to my own post, but there's some additional
> information. It appears that all data *is* getting inserted fine... but
> that for some reason or other, I'm not getting a return status from the
> database, which accounts for the sleep condition -- the DB thinks it's
> still processing something, and then DB gets the timeout condition and
> my API returns an error. What I can't figure out is why the database
> feels there's more to process and won't return a successful status --
> and then, only from the web interface.
>
>
Are you quoting all of your SQL correctly? It *could* be a problem
with that... Could you show us some of the SQL?
--
Justin Patrin