ssb: Chasing intermittent SQLITE_ERROR with multiple processes accessing the database. Switching to sqlite3_prepare_v2 for better errors, but maybe this is also the solution?

This commit is contained in:
2025-05-21 22:05:33 -04:00
parent 61ae9ae465
commit 92926fa8df
9 changed files with 87 additions and 79 deletions

View File

@ -2834,7 +2834,11 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
}
if (ssb->db_writer)
{
sqlite3_close(ssb->db_writer);
int r = sqlite3_close(ssb->db_writer);
if (r != SQLITE_OK)
{
tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r));
}
ssb->db_writer = NULL;
}
while (ssb->broadcasts)
@ -2846,7 +2850,11 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
}
for (int i = 0; i < ssb->db_readers_count; i++)
{
sqlite3_close(ssb->db_readers[i]);
int r = sqlite3_close(ssb->db_readers[i]);
if (r != SQLITE_OK)
{
tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r));
}
}
ssb->db_readers_count = 0;
if (ssb->db_readers)