Showing posts with label persistance. Show all posts
Showing posts with label persistance. Show all posts

Monday, July 12, 2010

Clearing Cache for WebLogic instance

Hey smart WLA, 

Here I am with one more interesting story of WebLogic Administration "Clearing Cache". This is most often in development environments, where you need to clear the cache for new releases for Web-tier changes, XML loadings, JDBC connection changes, JMS issues, etc.,.

Some of the great developers think like this "I can change minor things directly in the jsp files to test stuff"

What is actually WebLogic Cache?

Basically all the web-tier related files (.jsp .class, JSPCompiled files etc.,) get stored in ./wlnotdelete/app_yourapplicaiton directory. This is treated as cache whenever there is a restart of a WebLogic instance happen then the WebLogic server will look up for last serviced object status stored in the cache to service for any pending requests. Usually, when your EJB Classes need sessions, JMS object requires persistence, your web-tier may contain static contents then Cache will be used by WebLogic Application Server instance.

WebLogic Clear Cache
Cache Clearing in WebLogic Domain



Why we need to remove Cache?

Whenever your application is accessed for the first time that fresh deployment of a new version, WebLogic server lookup in this directory, if there are older objects persists that will be a conflict with new code objects. This is where the need of removal of cache arises.

Where there is a need of a new version deployment we might need to clear the cache when the changes to the new version is not reflected. In the old version WebLogic 8.1 below we used to remove the .wldonotdelete folder. In the new version of WebLogic 9.x onwards removal of cache means deleting each server instance's tmp folder contains cache, stage folders or you can simply remove tmp folder too provided there should not be configuration changes happen to the server.

Generally for WebLogic 9.x and higher versions
WIN: C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp
UNIX: /bea/user_projects/domains/yourdomain/servers/yourserver/tmp

you can use the following commands to clear the cache:
WIN: rmdir C:\bea\user_projects\domains\yourdomain\servers\yourserver\tmp \s
UNIX: rm -rf /bea/user_projects/domains/yourdomain/servers\yourserver/tmp

Here I am removing all the subdirectories and files in the given directory.

When to do this Clearing Cache?

After Stopping the WebLogic server instance you can go for removal of cache.
Mostly, Spring framework users, struts framework users have this no changes reflected issue for their web applications.

An alternative solution is you can use the 'stage' mode set to 'no_stage' deployment. when undeployed an application then WebLogic server itself removes the cache objects.

Blurb about this blog

Blurb about this blog

Essential Middleware Administration takes in-depth look at the fundamental relationship between Middleware and Operating Environment such as Solaris or Linux, HP-UX. Scope of this blog is associated with beginner or an experienced Middleware Team members, Middleware developer, Middleware Architects, you will be able to apply any of these automation scripts which are takeaways, because they are generalized it is like ready to use. Most of the experimented scripts are implemented in production environments.
You have any ideas for Contributing to a Middleware Admin? mail to me wlatechtrainer@gmail.com
QK7QN6U9ZST6