Page 1 of 1

application freezes under linux/Kylix when MySql server down

Posted: Fri 02 Feb 2007 17:56
by carlotoffolon
Hi to all.
I have a simple but serious problem:

I have a PC running under Linux (Debian 3.1) with the application, ad another (XP) with MySql server.

My app opens a connection and a table, and everithings works fine.

After that I disconnect the server (by unplug the lan cable).

At this point when I try to make MyConn.Ping (or any other command like Table1.Active:=True, etc. ) the application freezes, even if I put MyConn.Ping in a Try...Except statement.

Note that MyConn1.ConnectionTimeOut is set to 15 and Table.CommandTimeOut is set to 10

I've put the Ping in a timer:
Try
MyConn1.Ping;
Except
// This never happens !!!!
Caption:='Errore ' + TimeToStr(Now);
End;

Whe I reconnect the cable on the server (sometimes) the application starts goin well again...

Question is:
How can I check if the connection is REALLY connected (when .Ping seems that does not work under Linux)?

My MyDac version is 4.40.0.20 running under Kylix3.

Thank You,
Carlo

Posted: Tue 06 Feb 2007 11:16
by Antaeus
Please perform the following experiment:
- place the TMyQuery component onto the form (MyQuery1);
- set the CommandTimeOut property of MyQuery1 to a small value, for example 5;
- run the application;
- connect to server;
- unplug network cable;
- execute a command by MyQuery1;
- note the query execution time.

Inform us if the error is raised and the expired time corresponds to the assigned value.

Posted: Thu 12 Jul 2007 09:12
by carlotoffolon
Hi,

I tried the experiment as you suggested
and after unplug network cable
and after execute a command by MyQuery1
the application freezes for about 15 minutes.
When I reconnect the cable on the server the application starts goin well again...

I think MyConnection.ConnectionTimeOut and MyQuery.CommandTimeout
don't work on Linux.

On Windows the same application works fine.

Any suggestions ?

Thanks in adavance

Posted: Fri 13 Jul 2007 14:19
by Antaeus
Unfortunately this is a restriction of your operating system. MyDAC uses the operating system setsockopt function with the SO_RCVTIMEO parameter to set socket timeout, but this parameter is read-only for Linux. So, MyDAC cannot set the socket timeout under Linux.

Posted: Wed 03 Oct 2007 13:26
by bohnzinho
Hi,

I solve this problem on linux, executing the following commands:

echo 1 > /proc/sys/net/ipv4/tcp_retries1
echo 1 > /proc/sys/net/ipv4/tcp_retries2


Make this and the MyDac create an exception when I unplug the lan cable. I use MyDac with Kylix3, acessing one server with linux/oracle.