bea.com | products | dev2dev | support | askBEA |
![]() |
![]() |
|
![]() |
e-docs > Liquid Data for WebLogic > Administration Guide > Configuring the Query Results Cache |
Administration Guide
|
Configuring the Query Results Cache
This topic describes how to manage caching for stored queries in BEA Liquid Data for WebLogicTM. It contains the following sections:
Notes: Caching is used with stored queries only. Caching does not apply to ad hoc queries, which are never cached.
After the Query Processor executes a query, it returns to the client the data that resulted from query execution. If Liquid Data results caching is enabled, the first time a query is run, Liquid Data saves its results into a query results cache. The next time the query is run with the same parameters, Liquid Data checks the cache configuration and, if the results have not expired, quickly retrieves the results from the cache rather than re-running the query. In this way, for queries that are executed repeatedly with the same parameters, using the results query cache reduces processing time and enhances overall system performance.
The query results cache is disabled by default and must be enabled according to the instructions in Enabling the Results Cache. Once enabled, you can configure the cache for individual stored queries as needed, specifying how long query results are stored in the cache before they expire (time out), and explicitly flushing the query cache. For more information, see Configuring Results Caching for Stored Queries.
In general, the results cache should be periodically refreshed to reflect data changes in the underlying data stores. The more dynamic the underlying data, the more frequently the cache should be set to expire. For queries on static data, you can configure the results cache so that it never expires.
If the cache policy expires for a particular query, Liquid Data flushes the cache result automatically on the next invocation.
In the event of a Liquid Data Server shutdown, the contents of the results cache are retained. Upon server restart, the Liquid Data Server resumes caching as before. Upon the first invocation of a cached query, the Liquid Data Server checks the results cache to determine whether the cached results for this query are valid or have expired, and then proceeds accordingly.
Note: The query results cache is stored in a database that you must explicitly configure. For more information, see Setting up the Results Cache Database.
Setting up the Results Cache Database
To use results caching, you must first set up the results cache database. To set up the results cache database you need to do the following:
Step 1: Install and Configure the Database Server
To use results caching, you first need to install and configure the database server according to your vendor's instructions. Liquid Data supports the following relational databases for caching:
Step 2: Run the SQL Script to Create the Cache Database
After you have installed and configured a database server, you need to run a SQL script on your database server that creates the Liquid Data cache database. Liquid Data provides the following scripts (in %WL_HOME%\liquiddata\server\dbscripts):
Step 3: Create the JDBC Data Source for the Cache Database
After you have created the Liquid Data cache database, you need to create a JDBC data source in WebLogic Server that points to the Liquid Data cache database. Using the Administration Console, create a JDBC data source named ldCacheDS according to the instructions for Creating a JDBC Data Source.
Note: You must use the exact data source name, ldCacheDS, for caching to work.
Once created, you can enable the result cache, as described in the following section, Enabling the Results Cache
By default, results caching is disabled in Liquid Data. To use results caching, you must explicitly enable it in the General tab on the Liquid Data node in the Administration Console. Before you enable caching, make sure that you have set up the Liquid Data cache database as described in Setting up the Results Cache Database.
Note: If caching is enabled but the cache data source has not been configured, an exception is thrown in the Administration Console.
To enable result caching in Liquid Data:
Once caching is enabled, you must explicitly configure the results cache according to the instructions in the following section, Configuring Results Caching for Stored Queries.
Configuring Results Caching for Stored Queries
Each stored query has its own cache policy that determines how Liquid Data manages results caching for that stored query. This topic describes how to configure the cache policy for stored queries. It includes the following sections:
To configure the results cache for a stored query initially:
Note: The expiration time should reflect the degree to which the data in the underlying data source(s) is expected to change. In general, for more dynamic data (such as real-time data feeds), specify a shorter expiration time. For more static data (such as general product or personnel information), specify a longer expiration time.
To edit the cache policy for a stored query:
To remove the cache policy for a stored query:
The Administration Console removes the selected cache policy and flushes any cached results for this query.
Note: If you delete a stored query for which caching is enabled, Liquid Data also deletes the cached query plan and any cached results. For more information, see Deleting Folders and Files in the Server Repository.
Liquid Data flushes the cached query result for a given stored query whenever:
Liquid Data flushes the cached query result for a given stored query on the next invocation whenever:
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |