Skip Headers

# Querying and the Cache

Previous

Next

A query that is run against the shared session cache is known as an in-memory query. Careful configuration of in-memory querying can improve performance (see "Using In-Memory Queries").

By default, a query that looks for a single object based on primary key attempts to retrieve the required object from the cache first, searches the data source only if the object is not in the cache. All other query types search the database first, by default. You can specify whether a given query runs against the in-memory cache, the database, or both.

For more information, see "Queries and the Cache".