Here is the caching works in websphere and hibernate:
5.1Caching in the Portlet Container
�Websphere portal supports fragment caching (also called
Servlet caching) using the WAS dynamic cache to keep the portlet output in the cache. There is no time consuming installation and integration work needed to activate fragment caching since it is handled in portlet.xml file.
�Cache- Expiration time can be set according to management ie. <expiration-cache>300</expiration-cache>.
5.2Caching in Remote caches
�Websphere portal offers adaptive page-caching feature, using it pages will be cached external to portal server (remote caches), if all the page components indicate that they�re cacheable. For getting more detail information about static and dynamic caching please refer to Develop high performance Web sites with both static and dynamic content using WebSphere Portal V5.1.
5.3Object caching (ie. Hibernate Caching)
Hibernate has two level cache architecture.
oThe first level cache is the Session itself. Since Session object is associated with the transaction, the cache is at transaction scope. The first level cache can�t be turned off.
oThe second level cache is pluggable and can be scoped to process and cluster. It is a cache of state. Hibernate also support implementation of a query result cache with second level cache.
There are various options to implement second level cache.
1.EHCache: It is a process scope cache. It supports the optional Hibernate query result cache.
2.OpenSymphony OSCache: It supports caching to memory and disk in a single JVM.
It also provides query cache support.
3.SwarmCache: It is clustered cache. It doesn�t support query cache.
4.JBossCache: It is clustered cache, with query cache support.