[Mondrian] MondrianOlap4jConnection requires creation of all RolapConnections

Ganong, Kenneth ken.ganong at truvenhealth.com
Fri Nov 7 10:42:32 EST 2014

I attempted to make a code change to solve this issue by having MondrianOlap4jConnection lazily-load its schema map. I was then able to create a Connection without loading all of the schemas. Unfortunately, an XML/A request for Mdschema Cubes will call getOlapCatalogs on the OlapConnection, causing the schema loads for every catalog even though the XML/A request specified a catalog name.

I am now attempting to have the Catalog’s schema’s be lazily-loaded as well so that the schemas are not loaded for catalogs until the schemas are requested (i.e. not during the getOlapCatalogs method nor constructor of MondrainOlap4jConnection). This should allow discover requests that specific a catalog name to not load the schemas for other catalogs.

I’m also considering an option in the XML/A layer to short-cut selecting the catalog for the current connection. Instead of iterating over connection.getOlapCatalogs, it would call simply connection.getOlapCatalog to get the active catalog for the connection. This could be implemented as a property so that the XML/A layer avoids calling the method that requires loading of all schemas. This would require a change to MondrianOlapConnection so that the getOlapCatalog method no longer requires loading all catalogs and schemas.

I would be grateful for any feedback on the options I am considering to solve this open issue.


From: Ganong, Kenneth
Sent: Wednesday, October 29, 2014 9:01 AM
To: Mondrian developer mailing list
Subject: RE: [Mondrian] MondrianOlap4jConnection requires creation of all RolapConnections

Yes! Your jira issue does look like the same underlying cause as the issue I’ve run into.


From: mondrian-bounces at pentaho.org<mailto:mondrian-bounces at pentaho.org> [mailto:mondrian-bounces at pentaho.org] On Behalf Of Roland Bouman
Sent: Tuesday, October 28, 2014 6:06 PM
To: Mondrian developer mailing list
Subject: Re: [Mondrian] MondrianOlap4jConnection requires creation of all RolapConnections

Hi Ken,

is it possible that this is related to http://jira.pentaho.com/browse/MONDRIAN-1056?

On Tue, Oct 28, 2014 at 10:59 PM, Ganong, Kenneth <ken.ganong at truvenhealth.com<mailto:ken.ganong at truvenhealth.com>> wrote:
Hello Mondrian Developers,

We’ve encountered an issue in which a Discover query is creating RolapConnection’s for every schema defined in our Datasource.xml. This issue has been encountered in two forms:

•         A failed discover query when one of the unrelated connections ran into an exception during its construction.

•         Severe slow down when many catalogs where defined in Datasource.xml.

Here is what I’ve gathered from the cause of this issue. Is there something that we are doing incorrectly, is this a corner case, or is this a true issue with Mondrian 3.6?

In MondrianOlap4jConnection’s constructor, this for loop goes through every catalog in our Datasource.xml, including ones that are not related to this particular connection.

for (String catalogName : catalogFinder.getCatalogNames(connection))

Inside this for loop is the following line of code which ends up creating a RolapConnection to every schema referenced in Datasource.xml (again, not just the ones related to the connection).

                final Map<String, RolapSchema> rolapSchemas = catalogFinder.getRolapSchemas(connection, catalogName);

Our Datasource.xml has a single datasource with many catalogs in it, like this:

            <Catalog name="a42od970_a42od970_build">
            <Catalog name="a42od970_a42od970_secure1_build">
            <Catalog name="a42od378_a42od378_build">

The code path for creating all of these RolapConnections is:

•         MondrianOlap4jConnection.<init>

•         MondrianServerImpl.getRolapSchemas

•         FileRepository.getRolapSchemas

•         FileRepository$CatalogInfo.access

•         FileRepository$CatalogInfo.getRolapSchema

•         DriverManager.getConnection

I don’t understand why creating a single connection would require the creation of every one of these connections.


Mondrian mailing list
Mondrian at pentaho.org<mailto:Mondrian at pentaho.org>

Roland Bouman
blog: http://rpbouman.blogspot.com/
twitter: @rolandbouman
linkedin: http://www.linkedin.com/profile/view?id=5142800&trk=tab_pro

Author of "Pentaho Solutions" (Wiley, ISBN: 978-0-470-48432-6 http://tinyurl.com/lvxa88) and "Pentaho Kettle Solutions" (Wiley, ISBN: 978-0-470-63517-9 http://tinyurl.com/33r7a8m)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.pentaho.org/pipermail/mondrian/attachments/20141107/c67216da/attachment-0001.html 

More information about the Mondrian mailing list