Kitura / Kitura/Swift-Kuery-SQLite

[Issue] libsqlite3.dylib: illegal multi-threaded access to database connection?

Open
#50 0 comments 0 reactions 1 assignee Claimed by @adam-rocska View on GitHub
bug
Dominant language
Swift
Stars
16
Forks
12
PR merge metrics
No merged PRs in 30d

Description

macOS 10.15.6
Xcode 11.6

How do i resolve this problem?
#### [logging] BUG IN CLIENT OF libsqlite3.dylib: illegal multi-threaded access to database connection
```
self.pool = SQLiteConnection.createPool(filename: self.fileName,
poolOptions: ConnectionPoolOptions(initialCapacity: 10,
maxCapacity: 30))
Database.default = Database(pool)
```

#### Could update SQLiteConnection.swift ?
```
public static func createPool(_ location: Location = .inMemoryShared, poolOptions: ConnectionPoolOptions) -> ConnectionPool {
let connectionGenerator: () -> Connection? = {
let connection = SQLiteConnection(location)
//if sqlite3_open(location.description, &connection.connection) != SQLITE_OK {
if sqlite3_open_v2(location.description, &connection.connection, SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, nil) != SQLITE_OK {
return nil
}
.
.
.
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.