Skip to content

Commit 804d680

Browse files
fix(store): set busy_timeout before journal_mode=WAL to prevent immediate SQLITE_BUSY on lock contention
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c38853f commit 804d680

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/store/store.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,15 @@ static int configure_pragmas(cbm_store_t *s, bool in_memory) {
229229
if (in_memory) {
230230
rc = exec_sql(s, "PRAGMA synchronous = OFF;");
231231
} else {
232-
rc = exec_sql(s, "PRAGMA journal_mode = WAL;");
232+
rc = exec_sql(s, "PRAGMA busy_timeout = 10000;");
233233
if (rc != CBM_STORE_OK) {
234234
return rc;
235235
}
236-
rc = exec_sql(s, "PRAGMA synchronous = NORMAL;");
236+
rc = exec_sql(s, "PRAGMA journal_mode = WAL;");
237237
if (rc != CBM_STORE_OK) {
238238
return rc;
239239
}
240-
rc = exec_sql(s, "PRAGMA busy_timeout = 10000;");
240+
rc = exec_sql(s, "PRAGMA synchronous = NORMAL;");
241241
if (rc != CBM_STORE_OK) {
242242
return rc;
243243
}

0 commit comments

Comments
 (0)