[Mondrian] mondrian clear cache from other servlet

Luc Boudreau lucboudreau at gmail.com
Wed Jul 10 09:37:56 EDT 2013


You might not be hitting the same schema in cache. Using the datasource +
checksum is tricky. If a single character changes in the schema, the
checksum changes and you can't get a cache hit anymore, thus fragmenting
your cache by creating a bunch of different schemas.

One thing you might look into, the JdbcConnectionUuid connection property.
If defined, it forces Mondrian to use a given schema from the pool. Be wary
though, make sure that you don't assign the same UUID to two different
schemas, or you'll get weird things happening.

Luc


On Wed, Jul 10, 2013 at 5:08 AM, Martijn van den Broek <martijn at basesoft.com
> wrote:

> Hello fellow mondrians,
>
> We are running Mondrian using XMLA (compiled current git master) in a
> Tomcat 6 instance defined as following in web.xml:
>
>   <servlet>
>     <servlet-name>MondrianXmlaServlet</servlet-name>
>
>
> <servlet-class>mondrian.xmla.impl.DynamicDatasourceXmlaServlet</servlet-class>
>      ...
>   </servlet>
>
> Next to that in the same web.xml, we have our own XMLRPC servlet for
> controlling various mondrian tasks like writing schema files and
> controlling cache:
>
>   <servlet>
>     <servlet-name>IQubeXmlRpcServlet</servlet-name>
>
> <servlet-class>com.basesoft.iqube.xml.IQubeXmlRpcServlet</servlet-class>
>      ...
>  </servlet>
>
> In that second xmlrpc servlet a clearCache method is defined which
> accepts a mondrian connectionstring similar as the code below:
>
>         String datasource_info =
> "Provider=mondrian;JdbcDrivers=com.mysql.jdbc.Driver;Jdbc=jdbc:mysql://
> 127.0.0.1:3306/iqportal?user=xxx&password=xxx;Catalog=file:///home/martijn/workspace_ee/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/wtpwebapps/iqube/WEB-INF/queries/basesoft.settings.martijn.IQuest.xml;UseContentChecksum=true
> ;";
>
>         Connection conn = DriverManager.getConnection(datasource_info,
> null);
>         PrintWriter pw = new PrintWriter(System.out, true);
>         CacheControl cacheControl = conn.getCacheControl(pw);
>
>         for (Cube cube : conn.getSchema().getCubes()) {
>
>             CacheControl.CellRegion region =
> cacheControl.createMeasuresRegion(cube);
>
>             System.out.println("!! clearMemberCache: cache state before:");
>             cacheControl.printCacheState(pw, region);
>
>             cacheControl.flush(region);
>
>             System.out.println("!! clearMemberCache: cache state after:");
>             cacheControl.printCacheState(pw, region);
>
>             System.out.println("Cleared cache for cube '" +
> cube.getName() + "'");
>         }
>
> Now if an MDX query is executed against the XMLA server and then the
> clearCache() method on the XMLRPC servlet is called, the cache state is
> printed as empty. It is not possible to clear the mondrian cache this
> way anymore. This code used to work in mondrian 3.5 but it seems the API
> has changed. My guess is that I am requesting the mondrian connection
> wrong due to the recent olap4j changes.
>
> Any hints on how to get a proper connection? Any help is appreciated.
>
>
>
>
>
>
>
>
>
> --
> Kind regards,
>
> Martijn van den Broek
> BaseSoft Solutions B.V.
>
> Herengracht 564
> 1017 CH Amsterdam
> The Netherlands
>
> http://www.basesoftsolutions.com/
> +31(0)206847087
>
> Confidentiality notice
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> **********************************************************************
>
>
>
> _______________________________________________
> Mondrian mailing list
> Mondrian at pentaho.org
> http://lists.pentaho.org/mailman/listinfo/mondrian
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20130710/a2c99c86/attachment.html 


More information about the Mondrian mailing list