Cannot open sqlite3 database set WAL

I can open sqlite3 database set WAL with sqlite3_open_v2 function when I accessed the database the first time.

But when the second time SQL statement is checked with sqlite3_prepare_v2, the database cannot be opened.

I test in new project without setting Team in Signing on Xcode, then the program can be completed to run (the database can be opened the second time).

But I set the Signing option's Team for my developer ID, so the program cannot be completed, the error message is 'database couldn't be opened'.

Please teach me how to avoid this error.

Thanks for reading.

Answered by oboro in 297286022

I resolved.

The sqlite file set WAL is copied to cache folder, then the copied file is accessed as database and the copied file is copied to original sqlite file.

Xcode 9.2

Swift 4

SQLite3, version 3.22.0 (installed by cocoapod)

I found this program is completed when sandbox is switched off.

Accepted Answer

I resolved.

The sqlite file set WAL is copied to cache folder, then the copied file is accessed as database and the copied file is copied to original sqlite file.

Cannot open sqlite3 database set WAL
 
 
Q