Comment by johannes1234321
Comment by johannes1234321 21 hours ago
I have no experience in Go, but won't that be a full database lock and prevent transactions with more than one operation?
Comment by johannes1234321 21 hours ago
I have no experience in Go, but won't that be a full database lock and prevent transactions with more than one operation?
Setting MaxOpenConns to 1 essentially limits the number of concurrently running (write) transactions to 1, which is exactly what we want. Whenever a concurrent thread wants to open a new transaction it'll have to wait.
Note that the application needs to be aware of that there are two pools — one for write operations and one for reads (the latter with no or high connection limit). The separation can be ensured on SQLite level too by adding ?_query_only=1 to connection parameters or setting the respective pragmas in the read-only pool.