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

Commit ac6a8626 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Limit number of in-memory db connections to 1 per pool" into...

Merge "Merge "Limit number of in-memory db connections to 1 per pool" into oc-mr1-dev am: 0ee7495b am: 46ff95dd"
parents 6083b667 3735ad52
Loading
Loading
Loading
Loading
+6 −4
Original line number Original line Diff line number Diff line
@@ -1009,13 +1009,15 @@ public final class SQLiteConnectionPool implements Closeable {
    }
    }


    private void setMaxConnectionPoolSizeLocked() {
    private void setMaxConnectionPoolSizeLocked() {
        if ((mConfiguration.openFlags & SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING) != 0) {
        if (!mConfiguration.isInMemoryDb()
                && (mConfiguration.openFlags & SQLiteDatabase.ENABLE_WRITE_AHEAD_LOGGING) != 0) {
            mMaxConnectionPoolSize = SQLiteGlobal.getWALConnectionPoolSize();
            mMaxConnectionPoolSize = SQLiteGlobal.getWALConnectionPoolSize();
        } else {
        } else {
            // TODO: We don't actually need to restrict the connection pool size to 1
            // We don't actually need to always restrict the connection pool size to 1
            // for non-WAL databases.  There might be reasons to use connection pooling
            // for non-WAL databases.  There might be reasons to use connection pooling
            // with other journal modes.  For now, enabling connection pooling and
            // with other journal modes. However, we should always keep pool size of 1 for in-memory
            // using WAL are the same thing in the API.
            // databases since every :memory: db is separate from another.
            // For now, enabling connection pooling and using WAL are the same thing in the API.
            mMaxConnectionPoolSize = 1;
            mMaxConnectionPoolSize = 1;
        }
        }
    }
    }