Lost connection

Lost connection

am 08.07.2002 09:22:26 von Thomas Jalsovsky

Hello all,

I'm new on this list and I'm not sure that my problem cohere with
perl-mysql module.
I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
I have a perl script which runs in daemon mode and uses MySQL for
data manipulation. When I start the script some queries are procesessed
(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
after that I get:
DBD::mysql::st execute failed: Lost connection to MySQL server during
query
After this error message the script is working fine (there is a while
cycle for asking queries), no any lost connection (the script run 3 days
without any other error). When I restart the script the lost connection
appears again... (the lost connection error is on random queries).
I use forking (2 childs and the parent are using the same
connection).

What am I doing wrong? What should I look for?

Thanks in advance,
Thomas



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1855@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 09:50:29 von Uli B

I have experienced exactly the same problem some time ago.
As you mentioned the reason for this is that some
children and the parent share the same connection handle(fork()).=20
You could solve this by connecting (DBI->connect) AFTER=20
forking OR after fork() you have to reopen the connection
to mysql and thus creating a NEW connection handle for each
child.
You may want to check how many open connections to mysql exist.
In your case there is probably only one connection for serveral
children which causes "lost connection" warnings.=20
You should have as many individual connections as you have children +1=20
(parent) =3D 3.

Uli

At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
>
>Hello all,
>
> I'm new on this list and I'm not sure that my problem cohere with
>perl-mysql module.
> I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
>upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
> I have a perl script which runs in daemon mode and uses MySQL for
>data manipulation. When I start the script some queries are procesessed
>(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
>after that I get:
>DBD::mysql::st execute failed: Lost connection to MySQL server during
>query
>After this error message the script is working fine (there is a while
>cycle for asking queries), no any lost connection (the script run 3 days
>without any other error). When I restart the script the lost connection
>appears again... (the lost connection error is on random queries).
> I use forking (2 childs and the parent are using the same
>connection).
>
> What am I doing wrong? What should I look for?
>
> Thanks in advance,
> Thomas
>
>
>
>----------------------------------------------------------- ----------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail=20
>msql-mysql-modules-thread1855@lists.mysql.com
>
>To unsubscribe, send a message to the address shown in the
>List-Unsubscribe header of this message. If you cannot see it,
>e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

--=20
-----------------------------------------------
Ulrich Borchers
Brandenberger Straße 18, 41065 Mönchengladbach
fon +49-2161-175883
icq 1282868
-----------------------------------------------


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1856@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 09:50:29 von Uli B

I have experienced exactly the same problem some time ago.
As you mentioned the reason for this is that some
children and the parent share the same connection handle(fork()).=20
You could solve this by connecting (DBI->connect) AFTER=20
forking OR after fork() you have to reopen the connection
to mysql and thus creating a NEW connection handle for each
child.
You may want to check how many open connections to mysql exist.
In your case there is probably only one connection for serveral
children which causes "lost connection" warnings.=20
You should have as many individual connections as you have children +1=20
(parent) =3D 3.

Uli

At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
>
>Hello all,
>
> I'm new on this list and I'm not sure that my problem cohere with
>perl-mysql module.
> I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
>upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
> I have a perl script which runs in daemon mode and uses MySQL for
>data manipulation. When I start the script some queries are procesessed
>(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
>after that I get:
>DBD::mysql::st execute failed: Lost connection to MySQL server during
>query
>After this error message the script is working fine (there is a while
>cycle for asking queries), no any lost connection (the script run 3 days
>without any other error). When I restart the script the lost connection
>appears again... (the lost connection error is on random queries).
> I use forking (2 childs and the parent are using the same
>connection).
>
> What am I doing wrong? What should I look for?
>
> Thanks in advance,
> Thomas
>
>
>
>----------------------------------------------------------- ----------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail=20
>msql-mysql-modules-thread1855@lists.mysql.com
>
>To unsubscribe, send a message to the address shown in the
>List-Unsubscribe header of this message. If you cannot see it,
>e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

--=20
-----------------------------------------------
Ulrich Borchers
Brandenberger Straße 18, 41065 Mönchengladbach
fon +49-2161-175883
icq 1282868
-----------------------------------------------


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1856@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 11:02:15 von Thomas Jalsovsky

Thank you for your fast reaction. You were right, the problem was with the
childs, to many request with single connection...

=09Sorry for bothering the mailing-list.

=09Thanks again,
Thomas


On Mon, 8 Jul 2002, Uli B wrote:

> I have experienced exactly the same problem some time ago.
> As you mentioned the reason for this is that some
> children and the parent share the same connection handle(fork()).
> You could solve this by connecting (DBI->connect) AFTER
> forking OR after fork() you have to reopen the connection
> to mysql and thus creating a NEW connection handle for each
> child.
> You may want to check how many open connections to mysql exist.
> In your case there is probably only one connection for serveral
> children which causes "lost connection" warnings.
> You should have as many individual connections as you have children +1
> (parent) =3D 3.
>
> Uli
>
> At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
> >
> >Hello all,
> >
> >=09I'm new on this list and I'm not sure that my problem cohere with
> >perl-mysql module.
> >=09I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
> >upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
> >=09I have a perl script which runs in daemon mode and uses MySQL for
> >data manipulation. When I start the script some queries are procesessed
> >(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
> >after that I get:
> >DBD::mysql::st execute failed: Lost connection to MySQL server during
> >query
> >After this error message the script is working fine (there is a while
> >cycle for asking queries), no any lost connection (the script run 3 days
> >without any other error). When I restart the script the lost connection
> >appears again... (the lost connection error is on random queries).
> >=09I use forking (2 childs and the parent are using the same
> >connection).
> >
> >=09What am I doing wrong? What should I look for?
> >
> >=09Thanks in advance,
> > Thomas
> >
> >
> >
> >----------------------------------------------------------- ----------
> >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" befor=
e
> >posting. To request this thread, e-mail
> >msql-mysql-modules-thread1855@lists.mysql.com
> >
> >To unsubscribe, send a message to the address shown in the
> >List-Unsubscribe header of this message. If you cannot see it,
> >e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>
> --
> -----------------------------------------------
> Ulrich Borchers
> Brandenberger Straße 18, 41065 Mönchengladbach
> fon +49-2161-175883
> icq 1282868
> -----------------------------------------------
>
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-thread1856@lis=
ts.mysql.com
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1857@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 11:02:15 von Thomas Jalsovsky

Thank you for your fast reaction. You were right, the problem was with the
childs, to many request with single connection...

=09Sorry for bothering the mailing-list.

=09Thanks again,
Thomas


On Mon, 8 Jul 2002, Uli B wrote:

> I have experienced exactly the same problem some time ago.
> As you mentioned the reason for this is that some
> children and the parent share the same connection handle(fork()).
> You could solve this by connecting (DBI->connect) AFTER
> forking OR after fork() you have to reopen the connection
> to mysql and thus creating a NEW connection handle for each
> child.
> You may want to check how many open connections to mysql exist.
> In your case there is probably only one connection for serveral
> children which causes "lost connection" warnings.
> You should have as many individual connections as you have children +1
> (parent) =3D 3.
>
> Uli
>
> At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
> >
> >Hello all,
> >
> >=09I'm new on this list and I'm not sure that my problem cohere with
> >perl-mysql module.
> >=09I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
> >upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
> >=09I have a perl script which runs in daemon mode and uses MySQL for
> >data manipulation. When I start the script some queries are procesessed
> >(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
> >after that I get:
> >DBD::mysql::st execute failed: Lost connection to MySQL server during
> >query
> >After this error message the script is working fine (there is a while
> >cycle for asking queries), no any lost connection (the script run 3 days
> >without any other error). When I restart the script the lost connection
> >appears again... (the lost connection error is on random queries).
> >=09I use forking (2 childs and the parent are using the same
> >connection).
> >
> >=09What am I doing wrong? What should I look for?
> >
> >=09Thanks in advance,
> > Thomas
> >
> >
> >
> >----------------------------------------------------------- ----------
> >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" befor=
e
> >posting. To request this thread, e-mail
> >msql-mysql-modules-thread1855@lists.mysql.com
> >
> >To unsubscribe, send a message to the address shown in the
> >List-Unsubscribe header of this message. If you cannot see it,
> >e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>
> --
> -----------------------------------------------
> Ulrich Borchers
> Brandenberger Straße 18, 41065 Mönchengladbach
> fon +49-2161-175883
> icq 1282868
> -----------------------------------------------
>
>
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-thread1856@lis=
ts.mysql.com
>
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1857@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 19:38:03 von fision

Hi,

I have the same problem with a practice script (so, I didn't see it very
much), but I think it was because of the concurrents querys. I think you
can use a mutex algoritmth to prevent simultaneous access to the
connection, or maybe you can use semaphores.

Ni=F1o Fision

On Mon, 2002-07-08 at 04:50, Uli B wrote:
> I have experienced exactly the same problem some time ago.
> As you mentioned the reason for this is that some
> children and the parent share the same connection handle(fork()).=20
> You could solve this by connecting (DBI->connect) AFTER=20
> forking OR after fork() you have to reopen the connection
> to mysql and thus creating a NEW connection handle for each
> child.
> You may want to check how many open connections to mysql exist.
> In your case there is probably only one connection for serveral
> children which causes "lost connection" warnings.=20
> You should have as many individual connections as you have children +1=20
> (parent) =3D 3.
>=20
> Uli
>=20
> At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
> >
> >Hello all,
> >
> > I'm new on this list and I'm not sure that my problem cohere with
> >perl-mysql module.
> > I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
> >upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
> > I have a perl script which runs in daemon mode and uses MySQL for
> >data manipulation. When I start the script some queries are procesessed
> >(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
> >after that I get:
> >DBD::mysql::st execute failed: Lost connection to MySQL server during
> >query
> >After this error message the script is working fine (there is a while
> >cycle for asking queries), no any lost connection (the script run 3 days
> >without any other error). When I restart the script the lost connection
> >appears again... (the lost connection error is on random queries).
> > I use forking (2 childs and the parent are using the same
> >connection).
> >
> > What am I doing wrong? What should I look for?
> >
> > Thanks in advance,
> > Thomas
> >
> >
> >
> >----------------------------------------------------------- ----------
> >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" befor=
e
> >posting. To request this thread, e-mail=20
> >msql-mysql-modules-thread1855@lists.mysql.com
> >
> >To unsubscribe, send a message to the address shown in the
> >List-Unsubscribe header of this message. If you cannot see it,
> >e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>=20
> --=20
> -----------------------------------------------
> Ulrich Borchers
> Brandenberger Straße 18, 41065 Mönchengladbach
> fon +49-2161-175883
> icq 1282868
> -----------------------------------------------
>=20
>=20
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-thread1856@lis=
ts.mysql.com
>=20
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>=20



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1858@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 19:38:03 von fision

Hi,

I have the same problem with a practice script (so, I didn't see it very
much), but I think it was because of the concurrents querys. I think you
can use a mutex algoritmth to prevent simultaneous access to the
connection, or maybe you can use semaphores.

Ni=F1o Fision

On Mon, 2002-07-08 at 04:50, Uli B wrote:
> I have experienced exactly the same problem some time ago.
> As you mentioned the reason for this is that some
> children and the parent share the same connection handle(fork()).=20
> You could solve this by connecting (DBI->connect) AFTER=20
> forking OR after fork() you have to reopen the connection
> to mysql and thus creating a NEW connection handle for each
> child.
> You may want to check how many open connections to mysql exist.
> In your case there is probably only one connection for serveral
> children which causes "lost connection" warnings.=20
> You should have as many individual connections as you have children +1=20
> (parent) =3D 3.
>=20
> Uli
>=20
> At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
> >
> >Hello all,
> >
> > I'm new on this list and I'm not sure that my problem cohere with
> >perl-mysql module.
> > I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
> >upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
> > I have a perl script which runs in daemon mode and uses MySQL for
> >data manipulation. When I start the script some queries are procesessed
> >(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
> >after that I get:
> >DBD::mysql::st execute failed: Lost connection to MySQL server during
> >query
> >After this error message the script is working fine (there is a while
> >cycle for asking queries), no any lost connection (the script run 3 days
> >without any other error). When I restart the script the lost connection
> >appears again... (the lost connection error is on random queries).
> > I use forking (2 childs and the parent are using the same
> >connection).
> >
> > What am I doing wrong? What should I look for?
> >
> > Thanks in advance,
> > Thomas
> >
> >
> >
> >----------------------------------------------------------- ----------
> >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" befor=
e
> >posting. To request this thread, e-mail=20
> >msql-mysql-modules-thread1855@lists.mysql.com
> >
> >To unsubscribe, send a message to the address shown in the
> >List-Unsubscribe header of this message. If you cannot see it,
> >e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>=20
> --=20
> -----------------------------------------------
> Ulrich Borchers
> Brandenberger Straße 18, 41065 Mönchengladbach
> fon +49-2161-175883
> icq 1282868
> -----------------------------------------------
>=20
>=20
> ------------------------------------------------------------ ---------
> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
> posting. To request this thread, e-mail msql-mysql-modules-thread1856@lis=
ts.mysql.com
>=20
> To unsubscribe, send a message to the address shown in the
> List-Unsubscribe header of this message. If you cannot see it,
> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>=20



------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1858@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 22:24:11 von Uli B

Hi,
but why not make use of MySQL's capabilities in handling multiple
connections ? It is much easier to simply reconnect or
connect AFTER fork() if possible and thus opening a new connection,
than to implement a mutex algorithm which might also slow your=20
software down.
But I admit that you might be forced to make use of=20
shared connections in the unlikely case that too many children
have to deal with a low limit of maximum allowable
connections. THEN you would have to use semaphores as a
workaround. IMHO more than one process using the same connection
is not a good idea ,-) This might cause other problems:
what if i.e. one child dies ? Can another child
still access the connection ? What about LOCK which will probably
have no effect on a process that shares the same connection...

Uli


At 14:38 08.07.02 -0300, Ni=F1o Fision wrote:
>Hi,
>
>I have the same problem with a practice script (so, I didn't see it very
>much), but I think it was because of the concurrents querys. I think you
>can use a mutex algoritmth to prevent simultaneous access to the
>connection, or maybe you can use semaphores.
>
>Ni=F1o Fision
>
>On Mon, 2002-07-08 at 04:50, Uli B wrote:
>> I have experienced exactly the same problem some time ago.
>> As you mentioned the reason for this is that some
>> children and the parent share the same connection handle(fork()).=20
>> You could solve this by connecting (DBI->connect) AFTER=20
>> forking OR after fork() you have to reopen the connection
>> to mysql and thus creating a NEW connection handle for each
>> child.
>> You may want to check how many open connections to mysql exist.
>> In your case there is probably only one connection for serveral
>> children which causes "lost connection" warnings.=20
>> You should have as many individual connections as you have children +1=20
>> (parent) =3D 3.
>>=20
>> Uli
>>=20
>> At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
>> >
>> >Hello all,
>> >
>> > I'm new on this list and I'm not sure that my problem cohere with
>> >perl-mysql module.
>> > I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
>> >upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
>> > I have a perl script which runs in daemon mode and uses MySQL for
>> >data manipulation. When I start the script some queries are procesessed
>> >(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
>> >after that I get:
>> >DBD::mysql::st execute failed: Lost connection to MySQL server during
>> >query
>> >After this error message the script is working fine (there is a while
>> >cycle for asking queries), no any lost connection (the script run 3 days
>> >without any other error). When I restart the script the lost connection
>> >appears again... (the lost connection error is on random queries).
>> > I use forking (2 childs and the parent are using the same
>> >connection).
>> >
>> > What am I doing wrong? What should I look for?
>> >
>> > Thanks in advance,
>> > Thomas
>> >
>> >
>> >
>> >----------------------------------------------------------- ----------
>> >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"=
before
>> >posting. To request this thread, e-mail=20
>> >msql-mysql-modules-thread1855@lists.mysql.com
>> >
>> >To unsubscribe, send a message to the address shown in the
>> >List-Unsubscribe header of this message. If you cannot see it,
>> >e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>>=20
>> ------------------------------------------------------------ ---------
>> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>> posting. To request this thread, e-mail=20
>msql-mysql-modules-thread1856@lists.mysql.com
>>=20
>> To unsubscribe, send a message to the address shown in the
>> List-Unsubscribe header of this message. If you cannot see it,
>> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>>=20
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1859@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.

Re: Lost connection

am 08.07.2002 22:24:11 von Uli B

Hi,
but why not make use of MySQL's capabilities in handling multiple
connections ? It is much easier to simply reconnect or
connect AFTER fork() if possible and thus opening a new connection,
than to implement a mutex algorithm which might also slow your=20
software down.
But I admit that you might be forced to make use of=20
shared connections in the unlikely case that too many children
have to deal with a low limit of maximum allowable
connections. THEN you would have to use semaphores as a
workaround. IMHO more than one process using the same connection
is not a good idea ,-) This might cause other problems:
what if i.e. one child dies ? Can another child
still access the connection ? What about LOCK which will probably
have no effect on a process that shares the same connection...

Uli


At 14:38 08.07.02 -0300, Ni=F1o Fision wrote:
>Hi,
>
>I have the same problem with a practice script (so, I didn't see it very
>much), but I think it was because of the concurrents querys. I think you
>can use a mutex algoritmth to prevent simultaneous access to the
>connection, or maybe you can use semaphores.
>
>Ni=F1o Fision
>
>On Mon, 2002-07-08 at 04:50, Uli B wrote:
>> I have experienced exactly the same problem some time ago.
>> As you mentioned the reason for this is that some
>> children and the parent share the same connection handle(fork()).=20
>> You could solve this by connecting (DBI->connect) AFTER=20
>> forking OR after fork() you have to reopen the connection
>> to mysql and thus creating a NEW connection handle for each
>> child.
>> You may want to check how many open connections to mysql exist.
>> In your case there is probably only one connection for serveral
>> children which causes "lost connection" warnings.=20
>> You should have as many individual connections as you have children +1=20
>> (parent) =3D 3.
>>=20
>> Uli
>>=20
>> At 09:22 08.07.02 +0200, Thomas Jalsovsky wrote:
>> >
>> >Hello all,
>> >
>> > I'm new on this list and I'm not sure that my problem cohere with
>> >perl-mysql module.
>> > I'm using perl-5.8.0 on a RedHat 7.2 server (with some Rawhide
>> >upgrades). mysql-3.23.49 (from source), DBD-mysql-2.1017, DBI-1.27
>> > I have a perl script which runs in daemon mode and uses MySQL for
>> >data manipulation. When I start the script some queries are procesessed
>> >(I don't know an exact number, sometimes 5, somtimes 9 queries,...) and
>> >after that I get:
>> >DBD::mysql::st execute failed: Lost connection to MySQL server during
>> >query
>> >After this error message the script is working fine (there is a while
>> >cycle for asking queries), no any lost connection (the script run 3 days
>> >without any other error). When I restart the script the lost connection
>> >appears again... (the lost connection error is on random queries).
>> > I use forking (2 childs and the parent are using the same
>> >connection).
>> >
>> > What am I doing wrong? What should I look for?
>> >
>> > Thanks in advance,
>> > Thomas
>> >
>> >
>> >
>> >----------------------------------------------------------- ----------
>> >Please check "http://www.mysql.com/Manual_chapter/manual_toc.html"=
before
>> >posting. To request this thread, e-mail=20
>> >msql-mysql-modules-thread1855@lists.mysql.com
>> >
>> >To unsubscribe, send a message to the address shown in the
>> >List-Unsubscribe header of this message. If you cannot see it,
>> >e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>>=20
>> ------------------------------------------------------------ ---------
>> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>> posting. To request this thread, e-mail=20
>msql-mysql-modules-thread1856@lists.mysql.com
>>=20
>> To unsubscribe, send a message to the address shown in the
>> List-Unsubscribe header of this message. If you cannot see it,
>> e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.
>>=20
>


------------------------------------------------------------ ---------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail msql-mysql-modules-thread1859@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail msql-mysql-modules-unsubscribe@lists.mysql.com instead.