Skip to content

Commit

Permalink
Add full mutex flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bubelov committed Sep 23, 2024
1 parent b923ed3 commit 9fe6be3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/src/androidMain/kotlin/db/Database.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package db

import androidx.sqlite.SQLiteConnection
import androidx.sqlite.driver.bundled.BundledSQLiteDriver
import androidx.sqlite.driver.bundled.SQLITE_OPEN_CREATE
import androidx.sqlite.driver.bundled.SQLITE_OPEN_FULLMUTEX
import androidx.sqlite.driver.bundled.SQLITE_OPEN_READWRITE
import androidx.sqlite.execSQL
import androidx.sqlite.use
import area.AreaQueries
Expand All @@ -17,7 +20,10 @@ import java.util.concurrent.locks.ReentrantLock
class Database(path: String) {

private val conn: SQLiteConnection =
BundledSQLiteDriver().open(path)
BundledSQLiteDriver().open(
path,
SQLITE_OPEN_READWRITE or SQLITE_OPEN_CREATE or SQLITE_OPEN_FULLMUTEX
)
.apply {
execSQL("PRAGMA journal_mode=WAL")
execSQL("PRAGMA synchronous=NORMAL")
Expand Down

0 comments on commit 9fe6be3

Please sign in to comment.