Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b00dcebf authored by Steve Kondik's avatar Steve Kondik
Browse files

Don't bail if we can't set WAL mode on an SQLite database

Change-Id: Iabfe6830ea10df50f655b84ba3b24507f3f1ed4e
parent d4c7cfdd
Loading
Loading
Loading
Loading
+10 −12
Original line number Diff line number Diff line
@@ -126,12 +126,7 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags)
    // Configure databases to run in WAL mode.
    err = sqlite3_exec(handle,"PRAGMA journal_mode = WAL;",
                       NULL, NULL,&zErrMsg);
    if (SQLITE_OK != err) {
       LOGE("sqlite3_exec to set journal_mode = WAL failed\n");
       throw_sqlite3_exception(env, handle);
       goto done;
    }

    if (SQLITE_OK == err) {
        // Set autocheckpoint = 100 pages
        err = sqlite3_wal_autocheckpoint(handle,
                                         100);
@@ -140,6 +135,9 @@ static void dbopen(JNIEnv* env, jobject object, jstring pathString, jint flags)
            throw_sqlite3_exception(env, handle);
            goto done;
        }
    } else {
       LOGE("sqlite3_exec to set journal_mode = WAL failed\n");
    }

    // The soft heap limit prevents the page cache allocations from growing
    // beyond the given limit, no matter what the max page cache sizes are