Copy link to clipboard
Copied
I have an application that periodically throws this error
Error Executing Database Query.Communications link failure The last packet successfully received from the server was 878,178 milliseconds ago. The last packet sent successfully to the server was 18,954 milliseconds ago. The specific sequence of files included or processed is: .......
I think this is because the DB is on a different server.
Is there any suggestions on how to fix this issue.
The error occurs periodically.
If the DB issue cant be fixed could I use cfcatch.cftry to keep trying until the connection doesnt fail?
Maybe like this
<cftry> Problem DB query goes here <cfcatch ...> <cftry> TRY DB query AGAIN? <cfcatch ...> TRY DB query AGAIN? </cfcatch </cftry> </cfcatch> </cftry>
I agree with @sdsinc_pmascari that you should look for a database solution, rather than a CFML solution. With regard to this, I have a suggestion.
Copy link to clipboard
Copied
Most of the time when I've seen that error it was due to the DB server or service being restarted. I would focus on the DB issue.
The try-catch proposal you mentioned may work but is just a band-aid. Best solve the actual problem.
Copy link to clipboard
Copied
I agree with @sdsinc_pmascari that you should look for a database solution, rather than a CFML solution. With regard to this, I have a suggestion.