<font size="2">
<div>&nbsp;</div>
<div>In the below case</div>
<div>
<p>&lt;% mondrian.rolap.RolapSchema.clearCache(); %&gt;&nbsp; does not work with he 3.0 version of mondrian</p>
<p>How to clear Schema cache ?</p></div>
<div>&lt;%@ page session=&quot;true&quot; contentType=&quot;text/html; charset=iso-8859-1&quot; language=&quot;java&quot;</div>
<p>import=&#39;java.sql.*, javax.sql.*,javax.naming.*&#39;%&gt;</p>
<p>&nbsp;</p>
<p>&lt;%@ page import=&quot;mondrian.rolap.*;&quot; %&gt;</p>
<p>&lt;% mondrian.rolap.RolapSchema.clearCache(); %&gt;</p>
<p></p>
<p>&nbsp;</p>
<p>&lt;%@ taglib uri=&quot;<a href="http://www.tonbeller.com/jpivot">http://www.tonbeller.com/jpivot</a>&quot; prefix=&quot;jp&quot; %&gt;</p>
<p>&lt;%@ taglib prefix=&quot;c&quot; uri=&quot;<a href="http://java.sun.com/jstl/core">http://java.sun.com/jstl/core</a>&quot; %&gt;</p>
<p>&lt;jp:mondrianQuery id=&quot;query01&quot; jdbcDriver=&quot;oracle.jdbc.driver.OracleDriver&quot; jdbcUrl=&quot;jdbc:oracle:thin:@192.168.1.101:1521:orcl&quot; jdbcUser=&quot;nikilive&quot; jdbcPassword=&quot;nikilive&quot; </p>

<p>catalogUri=&quot;/WEB-INF/queries/FV_ADJUSTMENT_BI.xml&quot;&gt;</p>
<p>select NON EMPTY {[Measures].[Total Adjustments],[Measures].[Total Sales]} on columns, NON EMPTY </p>
<p>{([Company].[All Company],[Year].[All Year],[Customer].[All Customer])} ON rows from FV_ADJUSTMENT_BI</p>
<p>&lt;/jp:mondrianQuery&gt;</p>
<p>&lt;c:set var=&quot;title01&quot; scope=&quot;session&quot;&gt;&lt;%=result0%&gt;&lt;/c:set&gt;</p>
<p>&lt;%connection0.close();%&gt;</p></font>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Thanks</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>Hari Nair</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 8/15/08, <b class="gmail_sendername">Julian Hyde</b> &lt;<a href="mailto:jhyde@pentaho.com">jhyde@pentaho.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div dir="ltr" align="left"><span><font face="Verdana" color="#000080" size="2">Test case?</font></span></div><br>
<blockquote style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000080 2px solid; MARGIN-RIGHT: 0px">
<div lang="en-us" dir="ltr" align="left">
<hr>
<font face="Tahoma" size="2"><span class="q"><b>From:</b> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mondrian-bounces@pentaho.org" target="_blank">mondrian-bounces@pentaho.org</a> [mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:mondrian-bounces@pentaho.org" target="_blank">mondrian-bounces@pentaho.org</a>] <b>On Behalf Of </b>Haridasan T<br>
</span><b>Sent:</b> Thursday, August 14, 2008 9:13 PM<span class="q"><br><b>To:</b> Mondrian developer mailing list<br></span>
<div><span class="e" id="q_11bc5034aad4591a_4"><b>Subject:</b> Re: [Mondrian] Dimension member caching<br></span></div></font><br>&nbsp;</div>
<div><span class="e" id="q_11bc5034aad4591a_6">
<div></div>
<div>rolap.clearcache does not work with 3.0 of mondrian</div>
<div>It used to work with older versions</div>
<div>How to clear the cache using 3.0 of mondrian</div>
<div><br><br>&nbsp;</div>
<div><span class="gmail_quote">On 8/14/08, <b class="gmail_sendername"><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:michael.pflug@thomsonreuters.com" target="_blank">michael.pflug@thomsonreuters.com</a></b> &lt;<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:michael.pflug@thomsonreuters.com" target="_blank">michael.pflug@thomsonreuters.com</a>&gt; wrote:</span> 
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="EN-US" bgcolor="white" vlink="blue" link="blue">
<div>
<p><font face="Arial" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Arial">Thanks Mark.&nbsp; After some more discussion we agree that the best way to achieve our goal of never caching a dimension would not fall in line with 10788 because, as you pointed out, </span></font><font color="black"><span style="COLOR: windowtext">10788 is intended to minimize dimension table reads, not force them</span></font><font face="Arial" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Arial">.&nbsp; Our current thought is that we can implement a new method in the CacheControl API that takes a hierarchy, gets a MemberCacheHelper and calls MemberCacheHelper.flush() to flush the appropriate hierarchy.&nbsp; Does this sound like a valid solution?&nbsp; </span></font></p>

<p><font face="Arial" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Arial"></span></font>&nbsp;</p>
<p><font face="Arial" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Arial">Thanks,</span></font></p>
<p><font face="Arial" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Arial">Mike</span></font></p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></span></font>&nbsp;</p>
<p><font face="Arial" color="navy" size="2"><span style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></span></font>&nbsp;</p>
<div>
<div style="TEXT-ALIGN: center" align="center"><font face="Times New Roman" color="black" size="3"><span style="FONT-SIZE: 12pt; COLOR: windowtext">
<hr align="center" width="100%" size="2">
</span></font></div>
<p><b><font face="Tahoma" color="black" size="2"><span style="FONT-WEIGHT: bold; FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Tahoma">From:</span></font></b><font face="Tahoma" color="black" size="2"><span style="FONT-SIZE: 10pt; COLOR: windowtext; FONT-FAMILY: Tahoma"> Marc Berkowitz [mailto:<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:marcb52@speakeasy.net" target="_blank">marcb52@speakeasy.net</a>] <br>
<b><span style="FONT-WEIGHT: bold">Sent:</span></b> Saturday, August 09, 2008 12:25 AM<span><br><b><span style="FONT-WEIGHT: bold">To:</span></b> Mondrian developer mailing list<br></span><b><span style="FONT-WEIGHT: bold">Cc:</span></b> Pflug, Michael (TH USA)<span><br>
<b><span style="FONT-WEIGHT: bold">Subject:</span></b> Re: [Mondrian] Dimension member caching</span></span></font><font color="black"><span style="COLOR: windowtext"></span></font></p></div>
<p><font face="Times New Roman" color="black" size="3"><span style="FONT-SIZE: 12pt"></span></font>&nbsp;</p>
<p><font face="Times New Roman" color="black" size="3"><span style="FONT-SIZE: 12pt">(I wrote this code -- and am still fixing it -- so I&#39;ll try to answer these questions.)<span><br><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:michael.pflug@thomsonreuters.com" target="_blank">michael.pflug@thomsonreuters.com</a> wrote: </span></span></font></p>
<span><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">I plan to utilize the dimension member caching feature implemented</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">with check in 10788 but I have a few questions I&#39;m hoping the community</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">can help me out with before I get too far:&nbsp;&nbsp; </span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">&nbsp;</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">1)&nbsp; The feature is dependant on having the property</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">mondrian.rolap.EnableRolapCubeMemberCache=false, but I don&#39;t fully</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">understand the consequences of setting this property to false.&nbsp; Can</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">anyone elaborate? </span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">&nbsp;&nbsp;</span></font></pre></span>
<p><font face="Times New Roman" color="black" size="3"><span style="FONT-SIZE: 12pt">This is a tricky point;&nbsp; my own understanding may be warped, but I see it like this:<br>Usually a schema defines dimension members by referring to a dimension table. Mondrian creates a <i><span style="FONT-STYLE: italic">RolapMember</span></i> object when it is needed, reading its attributes from the dimension table. The resulting object is saved in a cache so it can be found again, avoiding reading from the table again. The cache also guarantees there is a unique <i><span style="FONT-STYLE: italic">RolapMember</span></i> for each member, and the cache has &quot;indexes&quot; to find related members (parent, children, level-peers) in constant time. It is a soft cache - unused members can be dropped from the cache for garbage collection -- <br>
and this is valid because should the member be needed again, it will just be read from the table and put again into the cache.<br><br>This design assumes that the dimension table doesn&#39;t change. My new feature helps deal with a dimension that changes in known small ways, letting an application edit selected items in the cache, or flush them from the cache to be reloaded with new values.<br>
<br>However, checkin 10203 of last november changed the cache design, introducing a two level cache. The goal was to deal with shared members in a shared dimension,&nbsp; used by several cubes. Now a member is represented by both a global <i><span style="FONT-STYLE: italic">RolapMember</span></i> (for all cubes) and a local <i><span style="FONT-STYLE: italic">RolapCubeMember</span></i> (one for each relevant cube). <br>
The cache structure is much more complicated -- so it seemed risky to alter it to add the new features. Therefore I implemented them to act on the simpler, single level member cache.<br>The property <i><span style="FONT-STYLE: italic">EnableRolapCubeMemberCache</span></i> was added so an application can choose the old one-level cache (which supports my cache edits), or the newer two-level cache<br>
(which does not, but offers the advantages of checkin 10203). I assume that 10203 pays off for shared dimensions, and has no advantage otherwise.<br><br><br></span></font></p><span><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">&nbsp;</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">2)&nbsp; In the unit test MemberCacheControlTest.testDeleteCommand(), the</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">test allows two possible outcomes - one that flushes only the desired</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">member and one that flushes the entire level.&nbsp; Walking through the test</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">it always seems to flush the entire level which is arguably less</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">desirable. Does anyone understand this behavior?&nbsp; </span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">&nbsp;</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">&nbsp; </span></font></pre></span>
<p><font face="Times New Roman" color="black" size="3"><span style="FONT-SIZE: 12pt">Flushing</span></font> more than requested is certainly sub-optimal, but strictly speaking it&#39;s not incorrect, since mondrian might flush the member cache spontaneously to reclaim space.<br>
<br></p><span><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">3)&nbsp; The code specifically does not allow flushing of parent-child</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">dimensions and, as luck would have it, the dimension I am most</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">interested in flushing is parent-child.&nbsp; There is no comment as to why</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">parent-child isn&#39;t allowed - can anyone fill me in on what the</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">difficultly might be in implementing this?</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">&nbsp; </span></font></pre>
</span>
<p><font face="Times New Roman" color="black" size="3"><span style="FONT-SIZE: 12pt">I avoided parent/child hierarchies because they have a more complex structure in the member cache. The existing design of member-cache edits might accommodate them, or it might require a complete rewrite. I&#39;d have to try it and see.&nbsp; However I think a refactoring of the member cache is likely in the near term, so it seems easier and maybe faster to wait for that, rtsher than do a rewrite.<br>
<br></span></font></p><span><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">&nbsp;</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">4)&nbsp; Finally, my specific use case is that I have a volatile dimension</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">that I wish never to be cached.&nbsp; I could clear the cache manually before</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">each query, but I&#39;d rather specify an optional property in my schema</span></font></pre>
<pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">telling Mondrian to never cache the dimension.&nbsp; Does anyone have any</span></font></pre><pre><font face="Courier New" color="black" size="2"><span style="FONT-SIZE: 10pt">objections to that implementation</span></font></pre>
</span>
<p><font face="Times New Roman" color="black" size="3"><span style="FONT-SIZE: 12pt">No, but that&#39;s a different goal to&nbsp; 10788, which is intended to minimize dimension table reads, not force them.<br>And it seems useful and (probably) simpler to implement than member-cache-edits!</span></font></p>
</div></div><br>_______________________________________________<br>Mondrian mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Mondrian@pentaho.org" target="_blank">Mondrian@pentaho.org</a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br><br></blockquote></div><br></span></div>
</blockquote></div><br>_______________________________________________<br>Mondrian mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Mondrian@pentaho.org">Mondrian@pentaho.org</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://lists.pentaho.org/mailman/listinfo/mondrian" target="_blank">http://lists.pentaho.org/mailman/listinfo/mondrian</a><br>
<br></blockquote></div><br>