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.
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>.
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" />
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
However, glad you solved it. Query timeout should affect sql command used in that job..
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.
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.