Cache invalidation in Oracle Applications
Cache invalidation in Oracle Applications
With the extended usage of Self Service Web Applications(SSWA) in Oracle Applications, the mechanism of cache invalidation assumes significant importance. In the process of supporting Oracle Application i am sure most of you would have already come across the cache invalidation mechanism and problems associated with it in Oracle Applications.
What do you mean by cache Invalidation?
The main purpose of the web cache is to cache frequently used data and reduce application response time for the end user. However in order to maintain the relevance of the cached data it is important that the old is flushed out or invalidated and new data is cached again. This process is referred to as cache invalidation. All the web server which support web cache have different mechanisms to deal with the invalidation process. These may be time based date based etc.Also invalidation maybe either automatic that is triggered by the application /Server itself or it may be manual like from the console or a simple deletion from the backend.
Cache Invalidation In Oracle Applications
The core web server of Oracle Applications is the apache based Oracle Application Server. The Oracle application Server Web Cache has the ability to cache both static and dynamic data.
The different methods of Invalidation supported by the Oracle Application Server Web Cache are
- Manual Invalidation through Web Server Console
- Manual invalidation through a telnet to the web server.
- Invalidation using PL/SQL,this is available via the wxvutil.sql scriptthe which can be obtained from http://otn.oracle.com/software/products/ias/web_cache/files/api_plsql.zip
- Invalidation from a JSP using the jesi:invalidation tag
Based on the circumstances encountered Oracle Applications also uses these mechanisms to perform cache invalidation to render the most relevant information when using self service web applications.
Oracle Applications implements a Cache Framework to effectively handle the caching mechanisms in E-Business Suite. This framework primarily includes
- Cache Manager: The cache manager is responsible for interacting between the business APIs and the cache components. The business APis request data from the cache via this manager.
- Cache Components: The actual data is stored in the form of cache components. The data is distributed in various cache components based of the attributes.
- Cache Class Loader: Each of the cache components are associated with a cache calss loader. when the data is requested by the business APIs via the cache manager to the cache component, if the object is present it is given back and in case of a miss (also referred as a cache miss) the cache class loader is responsible for fetching the data from the database and loading it into the cache component.
A common case of improper of cache invalidation is when you add a self service responsibility to a user and the user is not able to see that responsibility immediately. A work around is that you manually clear the cache or bounce your web server after which the change is reflected (as it does a force invalidation of your cache).However if you have applied your latest patches and roll ups you would not see this problem.
The Oracle Application cache Framework supports the following features
- Preloading: Preloading allows certain objects to be preloaded in the cache component along with the startup of the JVM. This increases performance by eliminating the need to lod the objects via the class loader.
- Distribution: In case of multiple JVMs in use the caching framework ensures that cache changes and invalidations are propogated in all the caches.
- Dadatabse Invalidation. the caching framework in applications also provides for an invalidation request to be originated from the database level. This means the database cahnges to the cached objects are sent as invalidation requests to the cache. To enable this feature you must however make sure that the Workflow Java Deferred Agent Listener is started in your instance.
- Event Support: Also supported by the applications cache framework is the support for events. This ensures that there is synchronization between inter dependent data in the cache. For this purpose event handlers are registered within the cache components.
You can run diagnostic test on your cache by going to the
http://<hostname>:<port>/OA_HTML/jtflogin.jsp
Another mechanism adopted by the web cache along with invalidation is Expiration. Expiration happens when the objects in the web cache are marked as invalid after a certain period of time. While invalidation is used for randomly changing objects the expiration method is adopted for objects which do not change so frequently.
Comments
This was very interesting,thanks very good post.
Ajay
Posted by: Ajay D | April 20, 2007 09:38 PM