I'm using olap4j 1.2.0 to connect to Microsoft Analysis Services.
My code is
Class.forName("org.olap4j.driver.xmla.XmlaOlap4jDriver");
OlapConnection olapConnection = DriverManager.getConnection(
"jdbc:xmla:Server=http://myserver:1234/OLAP/msmdpump.dll;Catalog=mycatalog")
.unwrap(OlapConnection.class);
CellSet cellSet = olapConnection.createStatement().executeOlapQuery("<MDX query>");
So, when I use Excel, query takes about a second. I take MDX query string from Excel (using macros) and put it into "MDX query" in my code. And execution takes about 145 seconds (depending on the date filter and the size of obtained data).
As I suppose, Excel uses a cache of MSAS, but olap4j doesn't. I know, that olap4j uses its own cache - when I execute 2 identical olap queries, the second query executes very fast (~300 ms).
The question is "is there any way to tell olap4j to use MSAS cache?"
I guess that Excel uses OLEDB to connect to MSAS and the cache policy is specified in connection string (or provided by OLEDB driver by default, I don't know), but I didn't find any similar parameter in XmlaOlap4jDriver.
Sorry for my not very good English and thanks in advance.