PDA

View Full Version : Cache issues



dart0
08-16-2005, 03:43 AM
I am using Mondrian together with JPivot. We are updating data in database every 15 minutes, so we need clear the cache every 15 minutes too. The thing is, that even when I do mondrian.rolap.cache.CachePool.instance().flush() the results remain the same.
First reason is obvious; there is CachingOlapModel in JPivot that caches the data too. But even when I clear the cache in the CachingOlapModel, the data are still not loaded from database. I suppose that there is some other cache inside of Mondrian. But I have no idea where.
Has someone experience with similar problem? The only solution that I have is to recreate OlapModel every time when the cache is cleared (I do not like this solution)

avix
08-16-2005, 06:42 AM
The cache is cleared for new connections only. Its currently not possible to replace the data during an analysis session.

dart0
08-16-2005, 08:11 PM
In this case you can get inconsistent data. Imagine that you are in the middle of an analysis session and at the data in DB are updated. Then you open some member whose children were not loaded to the cache yet. They are fetched from the database. In this case you will get strange mixture of old and new data in the result even if you clean the cache after the update!

avix
08-17-2005, 06:05 AM
Thats true unfortunately. Currently the DB can only be updated e.g. at night, when no session is active.
To implement real-time data, the CachePool.flush() (or RolapSchema.Pool) must do more work, instead of just emptying the schema cache it should inspect every schema and
1. clear the aggregations list in all its RolapStar instances
2. clear all MemberCaches and SmartMemberReader caches (belong to hierarchies of its cubes I think).
In mondrian.rolap there is a package.html containing UML diagrams that help to navigate the object graph.
That should not be too hard to implement.
Andreas