Sometimes when I view my webpage, which has a search form on it and then search for records in my database, and I let it sit there for a few minutes and then refresh or hit the back button, it throws up an error saying:

"500 Internal Server Error: There is a problem with the resource you are looking for, and it cannot be displayed. "

"Error executing database query
communications link failure. Last packet sent to the server was 0ms ago"

"The error occurred in D:\inetpub\michael-sexton\rlb\search.cfm line 2:"

1: <!---get records for query--->
2: <cfquery name ="rsBulbs" datasource="rlbulbs">
3: SELECT item
4: FROM rlbBulbs


You will notice in the SELECT statement, its pulling items from rlbBulbs. The b in bulbs here is capitalized, but when I view my page code it is not capitalized. I have looked at my database and the table is rlbbulbs, no caps there either. I have made sure I put the current page to the remote server.

Also, when I do get the error, I can usually click back and click search again and it displays the records with no problem. Does anyone know whats going on? I cant have clients coming to my page and get errors every other time they try to do a new search. Thanks for any help.

Dani AI

Generated

— The symptoms you describe (search works, then after sitting idle a refresh/back sometimes produces a transient DB-connection error, and a retry usually succeeds) strongly point to a stale pooled connection rather than a table-name case problem. The site is hosted under IIS on Windows, and MySQL on Windows is usually case-insensitive for table names (see MySQL docs on identifier case sensitivity), so the capitalization mismatch is unlikely to be the root cause.

Common, reliable troubleshooting steps are:

  • Reproduce the problem, then inspect ColdFusion exception logs and the MySQL server error log for closed/aborted connection messages.
  • Check MySQL idle timeouts (wait_timeout / interactive_timeout); servers will drop idle connections after those intervals. See MySQL documentation for the wait_timeout variable.
  • Check for intermediate network/firewall timeouts or NAT session timeouts between the web server and the DB server.

Fix approaches that work in production:

  • Increase MySQL idle timeout if appropriate, or shorten the datasource pool idle time / enable connection validation on the ColdFusion datasource so the server discards or tests stale connections before reuse.
  • As a fallback, implement a safe retry of the query on a transient connection error (catch once and retry), rather than relying on connector auto-reconnect settings.
    For ColdFusion tag and datasource behavior reference the ColdFusion cfquery documentation.

References: MySQL identifier case sensitivity, MySQL wait_timeout variable, .

Can anyone help?? I really need to get this resolved. Thanks in advanced!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.