mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 06:46:35 +03:00
sql: start transactions as IMMEDIATE
With the introduction of transactions in Contact::add_or_lookup(), python tests sometimes fail to create contacts with the folowing error: Cannot create contact: add_or_lookup: database is locked: Error code 5: The database file is locked `PRAGMA busy_timeout=60000` does not affect this case as the error is returned before 60 seconds pass. DEFERRED transactions with write operations need to be retried from scratch if they are rolled back due to a write operation on another connection. Using IMMEDIATE transactions for writing is an attempt to fix this problem without a retry loop. If we later need DEFERRED transactions, e.g. for reading a snapshot without locking the database, we may introduce another function for this.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
- use transaction in `Contact::add_or_lookup()` #4059
|
||||
|
||||
### Fixes
|
||||
- Start SQL transactions with IMMEDIATE behaviour rather than default DEFERRED one. #4063
|
||||
|
||||
### API-Changes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user