Monday, December 3, 2012

Disable cache in Jasper Analysis

As known JasperServer uses Pentaho Mondrian as base of Jasper Analysis component. Mondrian has elaborate cache which truly increases performance during using analysis views.

But  when we have not large database and need realtime OLAP the cache becomes a wall. And we want to turn off it.

I wanted to achive it using some properties in configuration and not using any Java code.

To disable cache you should
  • find file mondrian.properties (/WEB-INF/classes/)
  • add the following property with true value mondrian.rolap.star.disableCaching=true
  • save and restart your servlet container
After this all described measures in all schemas will be obtained from database, not the cache.

There is one more option to disable the cache for separate cube only. You should set attribute cache to false for Cube element in a schema. By default it has true value.

For instance,
<Cube name="SomeCube" cache="false" >

All above relates to cell cache only. It means when you disable the cache you will see realtime changes in data described as measures.

Unfortunately I have not found:
  • how to disable cache for dimension's members
  • how to flush cache automatically after deploying new version of schema file
So to clear cache for these cases we have to flush cache manualy.

Concerning the former case, as I have caught, now Modrian Cache Control API has more capabilities than Jasper Analysis uses. It provides ability to manipulate with dimension cache too.

All have been tested on JasperServer 4.7.0

No comments:

Post a Comment