1. Introduction

OracleAS Reports uses caching to improve performance. Every report that is run is cached, and a copy is stored in ORACLE_HOME\reports\cache directory. If you execute the same report again, OracleAS Reports Services recognizes the repeat command, and the cached copy of the report is returned (if configured), instead of running the request again.

There is an upper limit to the total size of files that can be stored in the Reports cache directory. When this upper limit is reached, some file(s) have to be deleted from the directory.

The default cache used with OracleAS Reports Services accepts the following parameters:

  • cacheSize: the maximum size of the cache, in Megabytes
  • cacheDir: path where the cached files are saved, optional, by default is REPORTS_HOME/cache
  • maxCacheFileNumber: maximum number of files in the cache, optional
  • ignoreParameters: parameter names to be ignored in constructing cache key, optional

The cache implementation is responsible for maintaining the cache within the maximum size specified. Once the size of the cache reaches the maximum limit, the cache deletes the older job using the "first-in first-out" logic (except if the job has its own invalidation time - see expiration and tolerance command line parameters).

Oracle Reports enables you to "plug" in any cache you wish, using the provided API. You can cache frequently requested data in any medium you choose. For example, you can choose to cache data in the database, the file system, or memory.

This tutorial will show you how to write your own cache using a size-based cache as an example. The implementation used in this example will use the logic of "size-based invalidation", i.e., once the cache reaches the maximum limit, the biggest files should be deleted to respect the sizeCache limit.

At the end of this tutorial, you will be able to:

  • Implement a Cache class with Oracle Reports
  • Register a Cache class with Oracle Reports
  • Use the Cache with Oracle Reports

Note that the size-based cache sample is certified with Oracle Reports 9i.

 


Copyright © 2002, Oracle Corporation. All rights reserved.