Hi,
I have a jsp to flush cache with following code:
java.util.Iterator<mondrian.rolap.RolapSchema> schemaIterator = mondrian.rolap.RolapSchema.getRolapSchemas().iterator();
while(schemaIterator.hasNext()){
mondrian.rolap.RolapSchema schema = schemaIterator.next();
mondrian.olap.CacheControl cacheControl = schema.getInternalConnection().getCacheControl(null);
for (mondrian.olap.Cube cube : schema.getCubes()) {
cacheControl.flush(cacheControl.createMeasuresRegion(cube));
}
}
It is not flushing the cache properly.
Debugging details:
1. During flushing, when control comes to SegmentCacheIndexImpl.intersectRegion, 'fuzzyFactMap' is always null and no 'SegmentHeader' is returned.
2. Then I found that the object of SegmentCacheManager was different when the segments were getting added and it was different when 'flush' was invoked.
3. When I debugged more, I found that two instances of 'MondrianServerImpl' are held by the registry -
1. static server - RolapSchema holds a connection to this server.
2. Server against notnull instanceId - XMLA connections get created against this server.
So when segments are added to the cache, they get added to XMLA's server (through MondrianServerImpl --> AggregationManager --> SegmentCacheManager --> SegmentCache).
And when the 'flush' gets invoked on cacheControl in above jsp, it gets invoked on the static server that is held by the RolapSchema.
What is it that I am doing wrong here? I found that above piece of code to flush cache seemed to work for most of the people. But it's not working for me.
Can somebody help me?
My setup details:
- I am using DynamicSchemaProcessor
- UseContentChecksum is true
- Mondrian version is 3.5
I have a jsp to flush cache with following code:
java.util.Iterator<mondrian.rolap.RolapSchema> schemaIterator = mondrian.rolap.RolapSchema.getRolapSchemas().iterator();
while(schemaIterator.hasNext()){
mondrian.rolap.RolapSchema schema = schemaIterator.next();
mondrian.olap.CacheControl cacheControl = schema.getInternalConnection().getCacheControl(null);
for (mondrian.olap.Cube cube : schema.getCubes()) {
cacheControl.flush(cacheControl.createMeasuresRegion(cube));
}
}
It is not flushing the cache properly.
Debugging details:
1. During flushing, when control comes to SegmentCacheIndexImpl.intersectRegion, 'fuzzyFactMap' is always null and no 'SegmentHeader' is returned.
2. Then I found that the object of SegmentCacheManager was different when the segments were getting added and it was different when 'flush' was invoked.
3. When I debugged more, I found that two instances of 'MondrianServerImpl' are held by the registry -
1. static server - RolapSchema holds a connection to this server.
2. Server against notnull instanceId - XMLA connections get created against this server.
So when segments are added to the cache, they get added to XMLA's server (through MondrianServerImpl --> AggregationManager --> SegmentCacheManager --> SegmentCache).
And when the 'flush' gets invoked on cacheControl in above jsp, it gets invoked on the static server that is held by the RolapSchema.
What is it that I am doing wrong here? I found that above piece of code to flush cache seemed to work for most of the people. But it's not working for me.
Can somebody help me?
My setup details:
- I am using DynamicSchemaProcessor
- UseContentChecksum is true
- Mondrian version is 3.5