Loading core/java/android/database/sqlite/SQLiteConnection.java +4 −0 Original line number Diff line number Diff line Loading @@ -1392,6 +1392,10 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen return sql.replaceAll("[\\s]*\\n+[\\s]*", " "); } void clearPreparedStatementCache() { mPreparedStatementCache.evictAll(); } /** * Holder type for a prepared statement. * Loading core/java/android/database/sqlite/SQLiteConnectionPool.java +10 −0 Original line number Diff line number Diff line Loading @@ -1126,6 +1126,16 @@ public final class SQLiteConnectionPool implements Closeable { mConnectionWaiterPool = waiter; } void clearAcquiredConnectionsPreparedStatementCache() { synchronized (mLock) { if (!mAcquiredConnections.isEmpty()) { for (SQLiteConnection connection : mAcquiredConnections.keySet()) { connection.clearPreparedStatementCache(); } } } } /** * Dumps debugging information about this connection pool. * Loading core/java/android/database/sqlite/SQLiteDatabase.java +4 −2 Original line number Diff line number Diff line Loading @@ -2088,10 +2088,12 @@ public final class SQLiteDatabase extends SQLiteClosable { try (SQLiteStatement statement = new SQLiteStatement(this, sql, bindArgs)) { return statement.executeUpdateDelete(); } finally { // If schema was updated, close non-primary connections, otherwise they might // have outdated schema information // If schema was updated, close non-primary connections and clear prepared // statement caches of active connections, otherwise they might have outdated // schema information. if (statementType == DatabaseUtils.STATEMENT_DDL) { mConnectionPoolLocked.closeAvailableNonPrimaryConnectionsAndLogExceptions(); mConnectionPoolLocked.clearAcquiredConnectionsPreparedStatementCache(); } } } finally { Loading Loading
core/java/android/database/sqlite/SQLiteConnection.java +4 −0 Original line number Diff line number Diff line Loading @@ -1392,6 +1392,10 @@ public final class SQLiteConnection implements CancellationSignal.OnCancelListen return sql.replaceAll("[\\s]*\\n+[\\s]*", " "); } void clearPreparedStatementCache() { mPreparedStatementCache.evictAll(); } /** * Holder type for a prepared statement. * Loading
core/java/android/database/sqlite/SQLiteConnectionPool.java +10 −0 Original line number Diff line number Diff line Loading @@ -1126,6 +1126,16 @@ public final class SQLiteConnectionPool implements Closeable { mConnectionWaiterPool = waiter; } void clearAcquiredConnectionsPreparedStatementCache() { synchronized (mLock) { if (!mAcquiredConnections.isEmpty()) { for (SQLiteConnection connection : mAcquiredConnections.keySet()) { connection.clearPreparedStatementCache(); } } } } /** * Dumps debugging information about this connection pool. * Loading
core/java/android/database/sqlite/SQLiteDatabase.java +4 −2 Original line number Diff line number Diff line Loading @@ -2088,10 +2088,12 @@ public final class SQLiteDatabase extends SQLiteClosable { try (SQLiteStatement statement = new SQLiteStatement(this, sql, bindArgs)) { return statement.executeUpdateDelete(); } finally { // If schema was updated, close non-primary connections, otherwise they might // have outdated schema information // If schema was updated, close non-primary connections and clear prepared // statement caches of active connections, otherwise they might have outdated // schema information. if (statementType == DatabaseUtils.STATEMENT_DDL) { mConnectionPoolLocked.closeAvailableNonPrimaryConnectionsAndLogExceptions(); mConnectionPoolLocked.clearAcquiredConnectionsPreparedStatementCache(); } } } finally { Loading