Skip to content

Commit 89d5db5

Browse files
committed
Fix mEnableWriteAheadLogging flag not passed to open
1 parent c807826 commit 89d5db5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sqlite-android/src/main/java/io/requery/android/database/sqlite/SQLiteOpenHelper.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,11 @@ private SQLiteDatabase getDatabaseLocked(boolean writable) {
228228
createConfiguration(path, SQLiteDatabase.OPEN_READONLY);
229229
db = SQLiteDatabase.openDatabase(configuration, mFactory, mErrorHandler);
230230
} else {
231+
int flags = mEnableWriteAheadLogging ?
232+
SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING : 0;
233+
flags |= SQLiteDatabase.CREATE_IF_NECESSARY;
231234
SQLiteDatabaseConfiguration configuration =
232-
createConfiguration(path, SQLiteDatabase.CREATE_IF_NECESSARY);
235+
createConfiguration(path, flags);
233236
db = SQLiteDatabase.openDatabase(configuration, mFactory, mErrorHandler);
234237
}
235238
} catch (SQLiteException ex) {

0 commit comments

Comments
 (0)