在我的應用程序中,我使用ORMLite將數據插入到SQLite數據庫中。在某些設備上,插入數據時出現以下錯誤:SQLite語句中止,數據庫鎖定在Android應用程序
02-05 09:29:56.864 22365-22441/com.app E/SQLiteLog﹕ (5) statement aborts at 2: [PRAGMA journal_mode=PERSIST]
02-05 09:29:56.864 22365-22441/com.app W/SQLiteConnection﹕ Could not change the database journal mode of '/data/data/com.app/databases/app.db' from 'wal' to 'PERSIST' because the database is locked. This usually means that there are other open connections to the database which prevents the database from enabling or disabling write-ahead logging mode. Proceeding without changing the journal mode.
我不知道如何解決ORMLite的這個問題。有沒有人有解決我的問題?只有訪問一個SQLOpenHelper不會解決我的問題,因爲我使用ORMLite,並且不要直接從我的代碼中使用SQLOpenHelper。
的可能的複製[Android的數據庫鎖定](http://stackoverflow.com/questions/7930139/android-database-locked) –
@AmitVaghela他沒有使用ORMLite –
檢查該解決方案將解決您的問題@Bart Bergmans –