{"record":{"id":"1ecdfcb038568858","repo":"pentaho/pentaho-kettle","slug":"error-closing-connection","errorCode":null,"errorMessage":"Error closing connection","messagePattern":"Error closing connection","errorType":"exception","errorClass":"KettleDatabaseException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/steps/olapinput/OlapHelper.java","lineNumber":104,"sourceCode":"    if ( !Utils.isEmpty( mdx ) ) {\n      CellSet tmp = stmt.executeOlapQuery( mdx );\n      result = tmp;\n    } else {\n      throw new Exception( \"Error executing empty MDX query\" );\n    }\n\n  }\n\n  public void close() throws KettleDatabaseException {\n    try {\n      if ( result != null ) {\n        result.close();\n      }\n      if ( olapConnection != null ) {\n        olapConnection.close();\n      }\n    } catch ( Exception e ) {\n      throw new KettleDatabaseException( \"Error closing connection\" );\n    }\n  }\n\n  /**\n   * Outputs one row per tuple on the rows axis.\n   *\n   * @throws KettleDatabaseException\n   *           in case some or other error occurs\n   */\n  public void createRectangularOutput() throws KettleDatabaseException {\n    if ( result != null ) {\n      CellDataSet cs = OlapUtil.cellSet2Matrix( result );\n      AbstractBaseCell[][] headers = cs.getCellSetHeaders();\n      headerValues = concatHeader( headers );\n      cellValues = castResult( cs.getCellSetBody() );\n    }\n  }\n","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/steps/olapinput/OlapHelper.java#L86-L122","documentation":"Wrapper error in OlapHelper.close(): closing the OLAP CellSet or the olap4j connection threw (the catch swallows the cause, so only this generic message surfaces). It fires during cleanup after querying, regardless of whether the query itself succeeded.","triggerScenarios":"Thrown at engine/src/main/java/org/pentaho/di/trans/steps/olapinput/OlapHelper.java:104 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify network reachability and OLAP server state; connections often fail to close after a server-side timeout","Close the CellSet/connection earlier or check for nulls before the helper's close()","Chain the original exception instead of swallowing it to expose the real cause"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}