Try our conversational search powered by Generative AI!

SqlConnection timeout while cleaning the trash


I got the next error in my log file after trying to cleanup my trash in Epi 9.6.1

System.Data.SqlClient.SqlException (0x80131904): Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding. ---> System.ComponentModel.Win32Exception (0x80004005): The wait operation timed out 

I tried to set the Connection Timeout=30 to Connection Timeout=30000 but that make no difference.

May 11, 2016 13:20

ConnectionTimeout you are changing should not affect SqlCommand timeouts (which is set by default to 30 seconds for the clear wastebasket command).

Try to configure <episerver.dataStore> element (NB! changes here are affecting whole site) and set <dataSettings @databaseQueryTimeout>.

May 11, 2016 22:33

Thanks for your reply. Unfortunatly adding the next episerver.datastore settings didn't work.

<section name="episerver.dataStore" type="EPiServer.Data.Configuration.EPiServerDataStoreSection, EPiServer.Data" />


           databaseQueryTimeout="0:05:00" />

Played around with the timeout from 1 minute to 3 hours. But with more than 10.000 items in trash the system keeps crashing. So what I did was creating a different implementation of the implementation of the EmptyWastebasketJob from Episerver.Util. You can find the snippet here: (what I basically did was changing -30 to -1) Empty Recycle bin snippet 

Edited, May 24, 2016 11:34

However, glad you solved it. Query timeout should affect sql command used in that job..

May 24, 2016 15:12

I know, but I didn't have the time to find out the exact cause of why these settings didn't have the expected result. So hopefully my answer give others with this problems enough information to fix it as well.

May 24, 2016 15:16

sp_editDeleteChild(s) in the database is usually a quick solution otherwise :) Don't forget to restart the webapplication afterwards so that cache is cleared.

May 24, 2016 15:58
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.