Closed enamor closed 2 years ago
This occurs when more than one thread is trying to access the DB. This library is not thread-friendly. My suggestion is that you create one global connection (in the AppDelegate for example) and use that connection all over your app.
issue also occurs if the db is open in 2 processes
Merged a fix to replace try!
by try?
.
Merged a fix to replace
try!
bytry?
.
I saw you reverted that change ?
Merged a fix to replace
try!
bytry?
.I saw you reverted that change ?
Yes, because as explained in #1075, you should use failableNext()
and handle the error by yourself using a do
/catch
block. We cannot provide a default behavior (e.g. return nil) when an error occurs, it's up to you to choose what you want to do.
extension FailableIterator { public func next() -> Element? { return try! failableNext() } }
Thread 1: Fatal error: 'try!' expression unexpectedly raised an error: disk I/O error (code: 10)