You may experience a timeout error or fail to get the correct result set when a stored procedure or complex SQL Select statement takes more than 30 seconds to execute.
Cause
There is a CommandTimeout option in the database connection configuration. CommandTimeout specifies the waiting time before terminating the attempt to execute a command and throwing an error. The default value is 30 seconds.
You should set values based on the actual needs, for example, if the SQL query would take more than 30 seconds to parse, you should increase the timeout value accordingly, otherwise, the data operations will fail when the timeout value is reached. Setting appropriate timeout periods for commands can reduce the occurrence of database deadlock and block.
Solution
You can set the command timeout value for each database connection in the project painter > Database page > Basic tab > More button > Advanced dialog > Command Timeout, or in the compiled PowerServer Web APIs > AppConfig > Applications.json > "Connections".
For more about timeout settings, refer to Configure the timeout settings.