An error has occurred while executing queries. Timeout expired

Error Message

    • Cyrious Control has encountered the following error:
    • The following error(s) have occurred while committing SQL transaction(s):
    • 0:
    • An error has occurred while executing queries.
    • Timeout expired
    • View SQLError file for full details.

Explanation of Error

This error can occur at almost any time, but occurs most commonly when attempting to create/edit/delete orders, estimates, or customers, or other times of heavy datase activity.

The general cause of any "timeout" error is that SQL was unable to write your changes because some other system has a lock on those records. This error can cause the loss of data in the case of new orders, estimates, etc. or the loss of edits when dealing with existing records.

Severity

Normal. This error may result in the loss of new data or just be an annoyance while searching for information.

Possible Root Cause(s)

The most common causes of "timeout" errors (in order of priority) are:

  1. A report executed within Control (by that user or anyone else) is causing a lock to occur on the SQL tables. Within Crystal Reports, any SQL Command must explicitly tell the database to not lock the records being access (using the WITH(NOLOCK) directive). Otherwise, Crystal Reports will lock these records and any attempt by any user to save or update them will be blocked. Eventually, the other user will get a timeout error.
  2. The system resources of your server computer (memory and hard-drive space, for instance) may have been fully consumed by other applications or services which causes a timeout to occur due to Microsoft SQL Server's inability to process the task in the allowed period of time before the SQL timeout occurred.
  3. The database may have reached the maximum size allowed if you are using one of the free versions of SQL Server such as MSDE or an SQL Server Express.
  4. Another user may be performing a specific task in Control which has caused the SQL database tables to enter a locked state. When these tables enter a locked state all reads and writes to those tables are unsuccessful and can result in the error message received. Control only locks records when adding or removing database fields (during an update) so this is rarely the cause of the problem.

Resolution

  • If this is the first occurrence of the error, Check the amount of free memory by examining Task Manager. If you have less than 512 MB free on the server, you should consider upgrading. Next have all users exit Control and restart your server. Check for sufficient hard-drive space on the server after booting up. If you don't have at least 1 GB free, you should address this to avoid any possible data loss. Upon restart of the server you may retry the task you were performing prior to the error occurring.
  • If you are encountering the error frequently, on the next occurrence ask all other users of Control to track what reports they are printing. Examine which reports were printed most recently before the lockup. You may be able to determine by their feedback whether you have a report that is causing the tables to enter a locked state. If this is found to be problem, you will need to have implementation or someone else edit the report and add the WITH(NOLOCK) directive.
  • Ensure the specifications of your server meet at least the minimum requirements. Keep in mind that the minimum requirements assume that you are using your server solely for housing the Control application. If you are using your server for additional tasks be sure the server has adequate resources (memory, cpu, hard drive space) to handle the additional tasks you require it to handle.

Additional Information

It is possible in some cases to insert the data from the SQL timeout error back into the database. For example, if the user was in the process of saying a large estimate or order and encountered this error there is a chance you can recover that information for them. These steps are only recommended for users who have a thorough understanding of managing Microsoft SQL Server databases. Additionally, all users must exit what they are doing immediately until it is done.

  • Locate the SQLError file. The default location for any SQLError file for Control is
    <%Control Install Path%>\Control\Logs\Control_SQLError.txt
  • Have all users close Control and shutdown the SSLIP.
  • Create a backup of the SQL database for Control.
  • Open SQL Management Studio and paste in the contents of the Control_SQLError.txt file except for the first 4 lines which contains the header information as shown below into a Query Window for the Control database.
    • 08/11/2009 12:26:37 PM
      Version: 04.10.0811.1301
      CYRIOUSSERVER (administrator)
      Timeout expired

      INSERT INTO TransHeader ([SEQID],
      [MODIFIEDBYUSER],
  • In this example the first line you would paste into the Query Window would be
    INSERT INTO TransHeader ([SEQID],
  • Execute the query to restore the data that was lost due to the SQL Timeout error.
  • Launch the Cyrious SSLIP and log into Control to verify your changes were properly posted. If you encounter any errors or problems related to this query you should restore the backup you created prior to starting.

Version Information

  • Version(s): All versions of Control.

See Also