diff --git a/pom.xml b/pom.xml
index 742fa5a..f9b98e5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -4,13 +4,13 @@
org.olap4j
- olap4j-xmlaserver
+ olap4j-xmlaserver-excel
TRUNK-SNAPSHOT
- bundle
olap4j-xmlaserver
- XML for Analysis (XMLA) server based upon olap4j connections
+ XML for Analysis (XMLA) server based upon olap4j connections
+with excel fixes
http://github.com/olap4j/olap4j-xmlaserver
2012
diff --git a/src/main/java/mondrian/xmla/PropertyDefinition.java b/src/main/java/mondrian/xmla/PropertyDefinition.java
index 21980da..58df83b 100644
--- a/src/main/java/mondrian/xmla/PropertyDefinition.java
+++ b/src/main/java/mondrian/xmla/PropertyDefinition.java
@@ -229,13 +229,50 @@ public enum PropertyDefinition {
XmlaConstants.Access.Read,
"false",
XmlaConstants.Method.DISCOVER_AND_EXECUTE,
- "");
+ ""),
+
+ //excell support
+ DbpropMsmdMDXCompatibility(
+ RowsetDefinition.Type.Integer,
+ null,
+ XmlaConstants.Access.ReadWrite,
+ "1",
+ XmlaConstants.Method.DISCOVER_AND_EXECUTE,
+ "DbpropMsmdMDXCompatibility" ),
+
+ MdxMissingMemberMode(
+ RowsetDefinition.Type.String,
+ null,
+ XmlaConstants.Access.ReadWrite,
+ "Error",
+ XmlaConstants.Method.DISCOVER_AND_EXECUTE,
+ "DbpropMsmdSubqueries" ),
+
+ SafetyOptions(
+ RowsetDefinition.Type.Integer,
+ null,
+ XmlaConstants.Access.ReadWrite,
+ "",
+ XmlaConstants.Method.DISCOVER_AND_EXECUTE,
+ "SafetyOptions" ),
+
+ MdpropMdxDrillFunctions(
+ RowsetDefinition.Type.Integer,
+ null,
+ XmlaConstants.Access.Read,
+ "3",
+ XmlaConstants.Method.DISCOVER_AND_EXECUTE,
+ "A bitmask indicating support for drilldown and drillup groups of functions. " )
+
+ ;
+
final RowsetDefinition.Type type;
final Set extends Enum> enumSet;
final XmlaConstants.Access access;
final XmlaConstants.Method usage;
- final String value;
+ /** it smells. is needed to suport excell*/
+ volatile String value;
final String description;
PropertyDefinition(
@@ -268,6 +305,12 @@ public enum PropertyDefinition {
public String getDescription() {
return description;
}
+
+ /** Excelt support. Need to set current catalog.
+ * it smells.*/
+ public void setValue(String v){
+ this.value=v;
+ }
}
// End PropertyDefinition.java
diff --git a/src/main/java/mondrian/xmla/Rowset.java b/src/main/java/mondrian/xmla/Rowset.java
index eaae106..8d24842 100644
--- a/src/main/java/mondrian/xmla/Rowset.java
+++ b/src/main/java/mondrian/xmla/Rowset.java
@@ -230,12 +230,16 @@ public final void populate(
e);
} finally {
handler.connectionFactory.endRequest(request1);
+
if (connection != null && ourConnection) {
+ LOGGER.debug("closing "+connection);
try {
connection.close();
} catch (SQLException e) {
// ignore
}
+ }else{
+ LOGGER.debug("refuse to close "+connection);
}
}
}
diff --git a/src/main/java/mondrian/xmla/RowsetDefinition.java b/src/main/java/mondrian/xmla/RowsetDefinition.java
index ced6df8..5a5ed7f 100644
--- a/src/main/java/mondrian/xmla/RowsetDefinition.java
+++ b/src/main/java/mondrian/xmla/RowsetDefinition.java
@@ -77,7 +77,8 @@ public enum RowsetDefinition {
// XMLA does not specify a sort order, but olap4j does.
new Column[] {
DiscoverDatasourcesRowset.DataSourceName,
- })
+ },
+ "06C03D41-F66D-49F3-B1B8-987F7AF4CF18")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DiscoverDatasourcesRowset(request, handler);
@@ -101,8 +102,9 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
DiscoverSchemaRowsetsRowset.SchemaGuid,
DiscoverSchemaRowsetsRowset.Restrictions,
DiscoverSchemaRowsetsRowset.Description,
+ DiscoverSchemaRowsetsRowset.RestrictionsMask
},
- null /* not sorted */)
+ null /* not sorted */, "EEA0302B-7922-4992-8991-0E605D0E5593")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DiscoverSchemaRowsetsRowset(request, handler);
@@ -205,7 +207,8 @@ protected void writeRowsetXmlSchemaRowDef(SaxWriter writer) {
DiscoverEnumeratorsRowset.ElementDescription,
DiscoverEnumeratorsRowset.ElementValue,
},
- null /* not sorted */)
+ null /* not sorted */,
+ "55A9E78B-ACCB-45B4-95A6-94C5065617A7")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DiscoverEnumeratorsRowset(request, handler);
@@ -233,7 +236,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
DiscoverPropertiesRowset.IsRequired,
DiscoverPropertiesRowset.Value,
},
- null /* not sorted */)
+ null /* not sorted */,
+ "4B40ADFB-8B09-4758-97BB-636E8AE97BCF")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DiscoverPropertiesRowset(request, handler);
@@ -254,7 +258,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
new Column[] {
DiscoverKeywordsRowset.Keyword,
},
- null /* not sorted */)
+ null /* not sorted */,
+ "1426C443-4CDD-4A40-8F45-572FAB9BBAA1")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DiscoverKeywordsRowset(request, handler);
@@ -279,7 +284,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
DiscoverLiteralsRowset.LiteralInvalidStartingChars,
DiscoverLiteralsRowset.LiteralMaxLength,
},
- null /* not sorted */)
+ null /* not sorted */,
+ "C3EF5ECB-0A07-4665-A140-B075722DBDC2")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DiscoverLiteralsRowset(request, handler);
@@ -306,7 +312,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
},
new Column[] {
DbschemaCatalogsRowset.CatalogName,
- })
+ },
+ "C8B52211-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DbschemaCatalogsRowset(request, handler);
@@ -343,7 +350,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
DbschemaColumnsRowset.TableCatalog,
DbschemaColumnsRowset.TableSchema,
DbschemaColumnsRowset.TableName,
- })
+ },
+ "C8B52214-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DbschemaColumnsRowset(request, handler);
@@ -377,13 +385,14 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
},
new Column[] {
DbschemaProviderTypesRowset.DataType,
- })
+ },
+ "C8B5222C-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DbschemaProviderTypesRowset(request, handler);
}
},
-
+/** Excel hurts otherwise
DBSCHEMA_SCHEMATA(
8, null,
new Column[] {
@@ -395,13 +404,13 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
DbschemaSchemataRowset.CatalogName,
DbschemaSchemataRowset.SchemaName,
DbschemaSchemataRowset.SchemaOwner,
- })
+ },"absent in MS OLE DB")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DbschemaSchemataRowset(request, handler);
}
},
-
+**/
/**
* http://msdn2.microsoft.com/en-us/library/ms126299(SQL.90).aspx
*
@@ -433,7 +442,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
DbschemaTablesRowset.TableCatalog,
DbschemaTablesRowset.TableSchema,
DbschemaTablesRowset.TableName,
- })
+ },
+ "C8B52229-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DbschemaTablesRowset(request, handler);
@@ -467,7 +477,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
DbschemaTablesInfoRowset.Description,
DbschemaTablesInfoRowset.TablePropId,
},
- null /* cannot find doc -- presume unsorted */)
+ null /* cannot find doc -- presume unsorted */,
+ "C8B522E0-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new DbschemaTablesInfoRowset(request, handler);
@@ -515,7 +526,7 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaActionsRowset.SchemaName,
MdschemaActionsRowset.CubeName,
MdschemaActionsRowset.ActionName,
- })
+ },"A07CCD08-8148-11D0-87BB-00C04FC33942")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaActionsRowset(request, handler);
@@ -571,7 +582,7 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaCubesRowset.CatalogName,
MdschemaCubesRowset.SchemaName,
MdschemaCubesRowset.CubeName,
- })
+ },"C8B522D8-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaCubesRowset(request, handler);
@@ -627,7 +638,7 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaDimensionsRowset.SchemaName,
MdschemaDimensionsRowset.CubeName,
MdschemaDimensionsRowset.DimensionName,
- })
+ },"C8B522D9-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaDimensionsRowset(request, handler);
@@ -672,7 +683,7 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaFunctionsRowset.InterfaceName,
MdschemaFunctionsRowset.FunctionName,
MdschemaFunctionsRowset.Origin,
- })
+ }, "A07CCD07-8148-11D0-87BB-00C04FC33942")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaFunctionsRowset(request, handler);
@@ -741,7 +752,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaHierarchiesRowset.CubeName,
MdschemaHierarchiesRowset.DimensionUniqueName,
MdschemaHierarchiesRowset.HierarchyName,
- })
+ },
+ "C8B522DA-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaHierarchiesRowset(request, handler);
@@ -814,7 +826,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaLevelsRowset.DimensionUniqueName,
MdschemaLevelsRowset.HierarchyUniqueName,
MdschemaLevelsRowset.LevelNumber,
- })
+ },
+ "C8B522DB-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaLevelsRowset(request, handler);
@@ -875,7 +888,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaMeasuresRowset.SchemaName,
MdschemaMeasuresRowset.CubeName,
MdschemaMeasuresRowset.MeasureName,
- })
+ },
+ "C8B522DC-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaMeasuresRowset(request, handler);
@@ -947,7 +961,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaMembersRowset.LevelUniqueName,
MdschemaMembersRowset.LevelNumber,
MdschemaMembersRowset.MemberOrdinal,
- })
+ },
+ "C8B522DE-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaMembersRowset(request, handler);
@@ -1018,7 +1033,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaPropertiesRowset.PropertyContentType,
MdschemaPropertiesRowset.Description
},
- null /* not sorted */)
+ null /* not sorted */,
+ "C8B522DD-5CF3-11CE-ADE5-00AA0044773D")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaPropertiesRowset(request, handler);
@@ -1058,7 +1074,8 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
MdschemaSetsRowset.CatalogName,
MdschemaSetsRowset.SchemaName,
MdschemaSetsRowset.CubeName,
- })
+ },
+ "A07CCD0B-8148-11D0-87BB-00C04FC33942")
{
public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
return new MdschemaSetsRowset(request, handler);
@@ -1067,6 +1084,7 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
transient final Column[] columnDefinitions;
transient final Column[] sortColumnDefinitions;
+ transient final String schemaGuid;
/**
* Date the schema was last modified.
@@ -1093,12 +1111,14 @@ public Rowset getRowset(XmlaRequest request, XmlaHandler handler) {
int ordinal,
String description,
Column[] columnDefinitions,
- Column[] sortColumnDefinitions)
+ Column[] sortColumnDefinitions,
+ String guid)
{
Util.discard(ordinal);
this.description = description;
this.columnDefinitions = columnDefinitions;
this.sortColumnDefinitions = sortColumnDefinitions;
+ this.schemaGuid = guid;
}
public abstract Rowset getRowset(XmlaRequest request, XmlaHandler handler);
@@ -1633,6 +1653,15 @@ protected void setProperty(
}
static class DiscoverSchemaRowsetsRowset extends Rowset {
+ // Excel
+ private static final Column RestrictionsMask =
+ new Column(
+ "RestrictionsMask",
+ Type.UnsignedLong,
+ null,
+ Column.NOT_RESTRICTION,
+ Column.OPTIONAL,
+ "");
private static final Column SchemaName =
new Column(
"SchemaName",
@@ -1697,12 +1726,15 @@ public int compare(
row.set(SchemaName.name, rowsetDefinition.name());
// TODO: If we have a SchemaGuid output here
- //row.set(SchemaGuid.name, "");
+ row.set(SchemaGuid.name, rowsetDefinition.schemaGuid);
row.set(Restrictions.name, getRestrictions(rowsetDefinition));
String desc = rowsetDefinition.getDescription();
row.set(Description.name, (desc == null) ? "" : desc);
+
+ //Excel
+ //row.set(RestrictionsMask.name, "" );
addRow(row, rows);
}
}
@@ -1803,8 +1835,9 @@ static class DiscoverPropertiesRowset extends Rowset {
Column.REQUIRED,
"The current value of the property.");
+ /* to be able to call setCatalogPropertyValue() */
protected boolean needConnection() {
- return false;
+ return true; //;
}
public void populateImpl(
@@ -1816,6 +1849,11 @@ public void populateImpl(
for (PropertyDefinition propertyDefinition
: PropertyDefinition.class.getEnumConstants())
{
+ if(propertyDefinition.name().equals(PropertyDefinition.Catalog.name()) &&
+ propertyDefinition.value.equals("")) {
+ setCatalogPropertyValue(connection);
+ }
+
if (!propNameCond.test(propertyDefinition)) {
continue;
}
@@ -1841,6 +1879,21 @@ protected void setProperty(
super.setProperty(propertyDef, value);
}
}
+
+ private void setCatalogPropertyValue(OlapConnection connection) {
+ LOGGER.debug("setting property value");
+ try {
+ LOGGER.debug("connection"+connection);
+ List catalogs = connection.getOlapCatalogs();
+ LOGGER.debug("catalogs length"+catalogs.size());
+ if(catalogs.size() !=0 ) {
+ PropertyDefinition.Catalog.setValue(catalogs.get(0).getName());
+ }
+ } catch (OlapException e) {
+ throw new RuntimeException(
+ "Failed to obtain a list of catalogs form the connection object.", e);
+ }
+ }
}
static class DiscoverEnumeratorsRowset extends Rowset {
@@ -2852,7 +2905,7 @@ protected void setProperty(
}
}
}
-
+/**
static class DbschemaSchemataRowset extends Rowset {
private final Util.Predicate1 catalogNameCond;
@@ -2918,7 +2971,7 @@ protected void setProperty(
}
}
}
-
+*/
static class DbschemaTablesRowset extends Rowset {
private final Util.Predicate1 tableCatalogCond;
private final Util.Predicate1 tableNameCond;
@@ -3923,8 +3976,8 @@ protected void populateDimension(
final XmlaHandler.XmlaExtra extra =
handler.connectionFactory.getExtra();
- int n = extra.getLevelCardinality(lastLevel);
- row.set(DimensionCardinality.name, n + 1);
+ int n = extra.getLevelCardinality(lastLevel); // Mondrian fix (see mondrian.rolap.RolapHierarchy.RolapHierarchy()) to comply with XMLA schema unsignedInt
+ row.set(DimensionCardinality.name, n==Integer.MIN_VALUE ? Integer.MAX_VALUE:n + 1);
// TODO: I think that this is just the dimension name
row.set(DefaultHierarchy.name, dimension.getUniqueName());
@@ -4461,7 +4514,10 @@ protected void populateHierarchy(
// cardinality. Consumers should not assume that this
// value is accurate.
int cardinality = extra.getHierarchyCardinality(hierarchy);
- row.set(HierarchyCardinality.name, cardinality);
+ row.set(HierarchyCardinality.name,
+ //cardinality
+ cardinality<0 ? Integer.MAX_VALUE:cardinality
+ );
row.set(
DefaultMember.name,
@@ -4829,7 +4885,7 @@ protected boolean outputLevel(
// According to microsoft this is:
// "The number of members in the level."
int n = extra.getLevelCardinality(level);
- row.set(LevelCardinality.name, n);
+ row.set(LevelCardinality.name, n<0 ? Integer.MAX_VALUE:n);
row.set(LevelType.name, getLevelType(level));
@@ -5950,7 +6006,7 @@ static class MdschemaPropertiesRowset extends Rowset {
"A human-readable description of the measure.");
protected boolean needConnection() {
- return false;
+ return true;
}
public void populateImpl(
@@ -5977,7 +6033,7 @@ public void populateImpl(
for (Property.TypeFlag typeFlag : typeFlags) {
switch (typeFlag) {
case MEMBER:
- populateMember(rows);
+ populateMember(rows, connection);
break;
case CELL:
populateCell(rows);
@@ -6007,10 +6063,11 @@ private void populateCell(List rows) {
}
}
- private void populateMember(List rows) throws SQLException {
- OlapConnection connection =
+ private void populateMember(List rows, OlapConnection connection) throws SQLException {
+ /* https://github.com/olap4j/olap4j-xmlaserver/issues/15
+ * OlapConnection connection =
handler.getConnection(
- request, Collections.emptyMap());
+ request, Collections.emptyMap());*/
for (Catalog catalog
: catIter(connection, catNameCond(), catalogCond))
{
@@ -6130,8 +6187,12 @@ private void outputProperty(
row.set(SchemaName.name, cube.getSchema().getName());
row.set(CubeName.name, cube.getName());
row.set(DimensionUniqueName.name, dimension.getUniqueName());
+ /*
row.set(HierarchyUniqueName.name, hierarchy.getUniqueName());
row.set(LevelUniqueName.name, level.getUniqueName());
+ */
+ row.set(HierarchyUniqueName.name, dimension.getUniqueName()+"."+hierarchy.getUniqueName());
+ row.set(LevelUniqueName.name, dimension.getUniqueName()+"."+hierarchy.getUniqueName()+"."+level.getUniqueName());
//TODO: what is the correct value here
//row.set(MemberUniqueName.name, "");
diff --git a/src/main/java/mondrian/xmla/XmlaHandler.java b/src/main/java/mondrian/xmla/XmlaHandler.java
index 8f85bb2..e641a26 100644
--- a/src/main/java/mondrian/xmla/XmlaHandler.java
+++ b/src/main/java/mondrian/xmla/XmlaHandler.java
@@ -14,15 +14,12 @@
import org.olap4j.xmla.server.impl.CompositeList;
import org.olap4j.xmla.server.impl.Util;
-
import org.apache.log4j.Logger;
-
import org.olap4j.*;
import org.olap4j.impl.Olap4jUtil;
import org.olap4j.metadata.*;
import org.olap4j.metadata.Property.StandardCellProperty;
import org.olap4j.metadata.Property.StandardMemberProperty;
-
import org.xml.sax.SAXException;
import java.io.PrintWriter;
@@ -662,6 +659,7 @@ private void checkFormat(XmlaRequest request) throws XmlaException {
+ "through"));
}
} else {
+ /** Excell needs to support Native
final String formatName =
properties.get(PropertyDefinition.Format.name());
if (formatName != null) {
@@ -673,7 +671,7 @@ private void checkFormat(XmlaRequest request) throws XmlaException {
": only 'Multidimensional', 'Tabular' "
+ "currently supported");
}
- }
+ }*/
final String axisFormatName =
properties.get(PropertyDefinition.AxisFormat.name());
if (axisFormatName != null) {
@@ -1301,6 +1299,7 @@ static void writeDatasetXmlSchema(SaxWriter writer, SetType settype) {
}
static void writeEmptyDatasetXmlSchema(SaxWriter writer, SetType setType) {
+ /* Excel
String setNsXmla = NS_XMLA_ROWSET;
writer.startElement(
"xsd:schema",
@@ -1316,6 +1315,7 @@ static void writeEmptyDatasetXmlSchema(SaxWriter writer, SetType setType) {
"name", "root");
writer.endElement(); // xsd:schema
+ */
}
private QueryResult executeDrillThroughQuery(XmlaRequest request)
@@ -1654,6 +1654,8 @@ private QueryResult executeQuery(XmlaRequest request)
try {
connection =
getConnection(request, Collections.emptyMap());
+ // @see https://github.com/olap4j/olap4j-xmlaserver/issues/9
+ final Connection closable = connection;
final XmlaHandler.XmlaExtra extra = connectionFactory.getExtra();
extra.setPreferList(connection);
try {
@@ -1675,18 +1677,52 @@ private QueryResult executeQuery(XmlaRequest request)
final Enumeration.ResponseMimeType responseMimeType =
getResponseMimeType(request);
final MDDataSet dataSet;
- if (format == Format.Multidimensional) {
+
+ /* Excell needs to support Native
+ * if (format == Format.Multidimensional) {
dataSet =
new MDDataSet_Multidimensional(
extra,
cellSet,
content != Content.DataIncludeDefaultSlicer,
responseMimeType
- == Enumeration.ResponseMimeType.JSON);
+ == Enumeration.ResponseMimeType.JSON){
+ @Override /// @see https://github.com/olap4j/olap4j-xmlaserver/issues/9
+ public void close() throws SQLException {
+ closable.close();
+ }
+ };
} else {
dataSet =
- new MDDataSet_Tabular(cellSet);
- }
+ new MDDataSet_Tabular(cellSet){
+ @Override /// @see https://github.com/olap4j/olap4j-xmlaserver/issues/9
+ public void close() throws SQLException {
+ closable.close();
+ }
+ };
+ }*/
+ if (format == Format.Tabular) {
+ dataSet =
+ new MDDataSet_Tabular(cellSet){
+ @Override /** @see https://github.com/olap4j/olap4j-xmlaserver/issues/9 */
+ public void close() throws SQLException {
+ closable.close();
+ }
+ };
+ } else {
+ dataSet =
+ new MDDataSet_Multidimensional(
+ extra,
+ cellSet,
+ content != Content.DataIncludeDefaultSlicer,
+ responseMimeType
+ == Enumeration.ResponseMimeType.JSON){
+ @Override /** @see https://github.com/olap4j/olap4j-xmlaserver/issues/9 */
+ public void close() throws SQLException {
+ closable.close();
+ }
+ };
+ }
success = true;
return dataSet;
} catch (XmlaException ex) {
@@ -1797,7 +1833,7 @@ static abstract class MDDataSet implements QueryResult {
protected MDDataSet(CellSet cellSet) {
this.cellSet = cellSet;
}
-
+ /** https://github.com/olap4j/olap4j-xmlaserver/issues/9 it closes nothing */
public void close() throws SQLException {
cellSet.getStatement().getConnection().close();
}
diff --git a/src/main/java/mondrian/xmla/impl/DefaultXmlaServlet.java b/src/main/java/mondrian/xmla/impl/DefaultXmlaServlet.java
index bc66612..ecbe5f3 100644
--- a/src/main/java/mondrian/xmla/impl/DefaultXmlaServlet.java
+++ b/src/main/java/mondrian/xmla/impl/DefaultXmlaServlet.java
@@ -282,10 +282,11 @@ protected void handleSoapHeader(
// Make sure Element has mustUnderstand=1 attribute.
Attr attr = e.getAttributeNode(SOAP_MUST_UNDERSTAND_ATTR);
- boolean mustUnderstandValue =
- attr != null
- && attr.getValue() != null
- && attr.getValue().equals("1");
+ boolean mustUnderstandValue = true;
+ // Excel
+ // attr != null
+ // && attr.getValue() != null
+ // && attr.getValue().equals("1");
if (!mustUnderstandValue) {
continue;
@@ -625,10 +626,6 @@ protected void marshallSoapMessage(
LOGGER.debug(buf.toString());
}
- if (LOGGER.isDebugEnabled()) {
- StringBuilder buf = new StringBuilder();
- buf.append("XML/A response content").append(nl);
- }
try {
int bufferSize = 4096;
ByteBuffer buffer = ByteBuffer.allocate(bufferSize);