List:General Discussion« Previous MessageNext Message »
From:Derick H Siddoway Date:April 13 1999 8:08pm
Subject:server has gone away, second try
View as plain text  
Okay, so I'm rewriting some stuff.

Originally, I made one connection to the database and used that handle
for all of my queries.  But then I started playing with fork(), and
Monty said that when you fork(), you have to connect *after* the fork().

Okay, hence the rewrite.  So now I have code that makes a connection
to the database for each query.  Fine enough, the initial tests ran
just fine.  So I decided to see if I could just create a 10 000 record
database with this code.  I began to see some

Error connecting to database: Success
Error in query: MySQL server has gone away
Error connecting to database: Success
Error in query: MySQL server has gone away
Error connecting to datbase: Success
... (etc, etc, etc)


So, I did some tests, and found that the first 100 connections do
not exhibit this behavior, but every connection after does this.
I thought that perhaps I was hitting the server too fast, so I put
a sleep() in, but the same thing happens.

mysqladmin version shows that the server has indeed been up the
whole time.

The manual says that the most common cause is a server timeout.
I don't think this is a timeout.
It also says that you can get this with incorrect or too-large
queries.  The first 100 go through just fine...

The table is simple:

CREATE TABLE temp1 (
	temp_id	INT NOT NULL,
	temp_value	INT,
	PRIMARY KEY (temp_id)
	);

I am incrementing the value for temp_id from 0 to 10 000.  (The table is
created fresh each run.)

Any ideas for me?

Thanks -

-- 
derick

Thread
server has gone away, second tryDerick H Siddoway14 Apr
  • RE: Row Locking issue in 3.23.xadam nelson14 May
Re: server has gone away, second tryDerick H Siddoway14 Apr
Re: server has gone away, second tryemilio lumia14 Apr