caching - mondrian dimension cache not getting flushed -


i trying flush mondrian dimension cache following code -

     org.olap4j.metadata.schema olapschema = olapconnection.getolapschema();      namedlist<org.olap4j.metadata.cube> cubelist =  olapschema.getcubes();      org.olap4j.metadata.member m = null;      for(org.olap4j.metadata.cube cube: cubelist) {     m = cube.lookupmember(identifiernode.parseidentifier( "[time].[2013].[jul2013]").getsegmentlist());        final cachecontrol cachecontrol = olapconnection.getcachecontrol(null);        cachecontrol.memberset regiontime = cachecontrol.creatememberset(mondrian.olap.member)m, false);        cachecontrol.flush(regiontime);       } 

but code throwing runtime error "mondrianolap4jmember , mondrian.olap.member incompatible"

looks need following flush cache - unwrap member object returned lookupmember function using olap wrapper class -

m = cube.lookupmember(identifiernode.parseidentifier( "[time].[2013].[jul2013]").getsegmentlist()); olapwrapper wrapper = (olapwrapper)m; mondrian.olap.member mondrianmember = wrapper.unwrap(mondrian.olap.member.class);

and call flush method -

cachecontrol.flush(mondrianmember);


Comments

Popular posts from this blog

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -