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

Commit b2d2ddc5 authored by Vasu Nori's avatar Vasu Nori
Browse files

reduce java locking on SQLiteDatabase if sql is already compiled

Change-Id: I6c2c593ba69aad201cedf097384d0b5d835c0839
parent 818505aa
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -76,11 +76,6 @@ public abstract class SQLiteProgram extends SQLiteClosable {
    }

    private void compileSql() {
        if (nStatement > 0) {
            // already compiled.
            return;
        }

        // only cache CRUD statements
        if (getSqlStatementType(mSql) == OTHER_STMT) {
            mCompiledSql = new SQLiteCompiledSql(mDatabase, mSql);
@@ -165,6 +160,10 @@ public abstract class SQLiteProgram extends SQLiteClosable {
            attachObjectToDatabase(db);
        }
        // compile the sql statement
        if (nStatement > 0) {
            // already compiled.
            return;
        }
        mDatabase.lock();
        try {
            compileSql();