SqlConnection timeout while cleaning the trash

Vote:
 

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.

#148369
May 11, 2016 13:20
Vote:
 

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>.

#148396
May 11, 2016 22:33
Vote:
 

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" />

..

  <episerver.dataStore>
    <dataSettings 
           connectionStringName="EPiServerDB"
           retries="5"
           retryDelay="0:0:0.1"
           databaseQueryTimeout="0:05:00" />
  </episerver.dataStore>



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 

#148789
Edited, May 24, 2016 11:34
Vote:
 

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

#148821
May 24, 2016 15:12
Vote:
 

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.

#148822
May 24, 2016 15:16
Vote:
 

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.

#148826
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.