Mailing List
Home
Forum Home
MySQL General - General MySQL discussion
MySQL++ - Programming with the C++ API to MySQL
MaxDB - Everything about MaxDB, formerly known as SAP DB
ODBC - ODBC with the MySQL Connector/ODBC driver
MySQL on Win32 - Runing MySQL on Windows 9x/Me/NT/2000/XP
Java Help - Mostly related to the MySQL Connector/J driver
Perl - Perl support for MySQL with DBI and DBD::mysql
GUI - MySQL GUI Tools
Announcement
Subjects
Subject: mysql openssl Question
ERROR 1045: Access denied for user: 'root@localhost ' (Using
password: NO)
Update one field with more fields from another table
Subject: Getting Identity after INSERT
ERROR 2002: Can 't connect to local MySQL server through socket
mysql test 4 1 fails with the gis test
Subject: MySQL Cluster Software
Downgrade Mysql from 4 to 3 23
Mysql 4 0 Oracle Stored Procedure Trigger Conversion
Can 't access mysql after kernel upgrade
Executing MySQL Commands From Within C Program
Comparing and writing out BLOBS
Subject: Re: Preventing Duplicate Entries
FULLTEXT query format question
Strange behavior, Table Level Permission
Does the binary log enabling affect the MySQL performances?
mysql:it 's a db not a dbms how it 's possible?!
mysql have same function mthod as Oracle decode()
 
Errors management

Errors management

2007-11-05       - By Russell E Glaue

 Back
Does the client loose the MySQL connection completely? Or is there just an error
in receiving the responding packet back?

Here is an idea:

You can do a ping to test the connection.

Fist ping the connection to verify you can send and receive on that connection.
Then send the SQL Command.

If you cannot ping the connection the first time, destroy the connection and
report "Connection lost to MySQL Server due to Network Errors."

If you get an errored network packet, then ping your connection a 2nd time to
test it to verify you still have the connection. Then report back to the client
"Network Error in receiving response from MySQL Server, your query may have been
successful, or maybe not."

If you get an errored network packet, and you cannot ping your connection a 2nd
time, then report back to the client, "Network connection lost, your query may
have been successful, or maybe not."


Does this happen more than 50% of the time?
If it does happen more than 50% of the time, you will want to add in more code
to test the connection every time, and verify the results of an SQL Command with
additional queries without relying only on the result MySQL sends back. This
will cost more on the client side.
If the client application is distributed to many users, you may want to set up a
flag to active this additional code, like "Turn on Paranoid MySQL Connections
with Follow Up Testing Methods"

-RG


NextWare - Mirko wrote:
> Hi All,
>
> I have this question...
> I send a INSERT from client to server, the server write the row and send
> the result "ok"
> to the client. Due to a network failure the client doesn't receive the
> result and an error is reported to the user.
> How can I manage this error?
>


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=mysql@(protected)