posted 15 years ago
I am working on an application that sends large quantities of data over the Internet to a remote Mysql database. When I wrote the application and tested locally, everything worked fine & dandy, but when I ran it on remote database I began getting lots of "Communications link failure" errors.
I have managed to compensate for the vast majority of these errors by performing a validity check on the Connection before each insert is made.
Code ran before each update is run ...
Code to get connection in MysqlDatabaseProxy class ...
Validity check ...
Connection validation checks work 99% of the time, but I am still getting isolated link failure errors.
The reason for this is that even though the connection is validated before an insert is made, the connection can still fail on any particular insert.
Is there a way to perform a check on the success on an insert based on the occurrence of a link failure exception and then have the program try again?
Example exception thrown
Any advice will be greatly appreciated.