Skip to content

Using plain DatabaseQueue's when sharing a Database - any risks? #1261

Answered by groue
Jasperav asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @Jasperav,

When sharing a database between several processes, putting the database in the WAL journaling mode can be useful. It reduces the odds that one process fails accessing the database because another process holds a lock on the database file. The WAL mode may also play some role in the prevention of the 0xdead10cc exception, but I'm not quite sure.

Still, reducing the odds of errors is the reason why the WAL mode is recommended.

The GRDB apis kind of conflate the mode of the database, and the DatabaseQueue and DatabasePool classes. But what really happens is that DatabaseQueue does not modify the journaling mode, while DatabasePool forces the WAL mode (except read-only). That…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@groue
Comment options

groue Aug 9, 2022
Maintainer

@Jasperav
Comment options

@groue
Comment options

@groue
Comment options

Answer selected by Jasperav
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants