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.
Understanding Results Caching
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
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:
Figure 18-1 Enabling Results Caching in the General Tab on the Liquid Data Node
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:
Creating the Cache Policy
To configure the results cache for a stored query initially:
Editing the Cache Policy
To edit the cache policy for a stored query:
Removing the Cache Policy
To remove the cache policy for a stored query:
Flushing the Cache
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:
![]() |
![]() |
![]() |
![]() |
||
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |