diff --git a/sources/caches2.php b/sources/caches2.php
index 4de6ec159a..50572e15fd 100644
--- a/sources/caches2.php
+++ b/sources/caches2.php
@@ -175,7 +175,11 @@ function set_cache_entry(string $codename, int $ttl, string $cache_identifier, $
                 'the_theme' => $theme,
                 'cached_for' => $codename,
                 'identifier' => md5($cache_identifier),
-            ]
+            ],
+            '',
+            null,
+            0,
+            true // Suppress errors in case we lost DB write access
         );
         $GLOBALS['SITE_DB']->query_insert(
             'cache',
diff --git a/sources/failure.php b/sources/failure.php
index 00a9948969..c160095f27 100644
--- a/sources/failure.php
+++ b/sources/failure.php
@@ -524,7 +524,7 @@ function _generic_exit($text, string $template, ?bool $support_match_key_message
     if ((get_forum_type() == 'cns') && (get_db_type() != 'xml'/*Too intensive*/) && (isset($GLOBALS['FORUM_DRIVER']))) {
         require_code('cns_groups');
         $restrict_answer = cns_get_best_group_property($GLOBALS['FORUM_DRIVER']->get_members_groups(get_member()), 'flood_control_submit_secs');
-        $GLOBALS['FORUM_DB']->query_update('f_members', ['m_last_submit_time' => time() - $restrict_answer - 1], ['id' => get_member()], '', 1);
+        $GLOBALS['FORUM_DB']->query_update('f_members', ['m_last_submit_time' => time() - $restrict_answer - 1], ['id' => get_member()], '', 1, 0, false, true); // Suppress errors in case we lost database write access
     }
 
     if ($title === null) {
diff --git a/sources/global3.php b/sources/global3.php
index 735f042bee..586eb06df1 100644
--- a/sources/global3.php
+++ b/sources/global3.php
@@ -3235,7 +3235,7 @@ function get_num_users_site() : int
             $PEAK_USERS_WEEK_CACHE = $NUM_USERS_SITE_CACHE;
 
             // But also delete anything else in the last 7 days that was less than the new weekly peak record, to keep the stats clean (we only want 7 day peaks to be stored)
-            $GLOBALS['SITE_DB']->query('DELETE FROM ' . get_table_prefix() . 'usersonline_track WHERE date_and_time>' . strval(time() - 60 * 60 * 24 * 7) . ' AND peak<=' . $PEAK_USERS_WEEK_CACHE);
+            $GLOBALS['SITE_DB']->query('DELETE FROM ' . get_table_prefix() . 'usersonline_track WHERE date_and_time>' . strval(time() - 60 * 60 * 24 * 7) . ' AND peak<=' . $PEAK_USERS_WEEK_CACHE, 1000, 0, true); // Errors suppressed in case DB write access broken
 
             // Set record for week
             set_value('user_peak_week', $PEAK_USERS_WEEK_CACHE);
