Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDX XmlaHandler.executeQuery() doesn't release connection if everything is ok #9

Open
m-khl opened this issue May 31, 2014 · 5 comments

Comments

@m-khl
Copy link

m-khl commented May 31, 2014

hello,
Thanks for your project. I'm experimenting with the own olap4j driver impl.

  • the problem starts from Olap4jPoolingConnectionFactory.getConnection() where the underlying connection (from my driver) is wrapped by dbcp.
  • as far as I understand this dbcp connection should be released by closing at XmlaHandler.executeQuery() however it's occurs if(!success) only
  • however there might be an attempt for closing it by closing result in XmlaHandler.execute() which leads to the
MDDataSet.close() {
            cellSet.getStatement().getConnection().close();
        }

that closes connection from underlying driver, but not the dbcp connection wrapper, that leaks it.

WDYT? How we can to elaborate this issue?
So far, I'll try to nuke the connection pooling.

@julianhyde
Copy link
Member

If executeQuery is successful, it will return an MDDataSet. That needs to have a valid CellSet object inside it, and if executeQuery() were to close the connection, it would make the CellSet invalid. MDDataSet.close() closes the connection.

So, make sure that MDDataSet.close() is being called.

Julian

@m-khl
Copy link
Author

m-khl commented Jun 2, 2014

@julianhyde thanks for your answer.

MDDataSet.close() is call fine and connection from the driver is closed successfully, but not the pooled connection obtained at Olap4jPoolingConnectionFactory.getConnection(), cellset just has no reference to it. How it can be released back to the pool?

@julianhyde
Copy link
Member

You may have found a bug. I can't be sure, but please log one to we can track.

Maybe the the proxy returned by Olap4jPoolingConnectionFactory.createDelegatingOlapConnection() should forward the close call to the DBCP connection. Or maybe the call to executeOlapQuery should generate a wrapper that closes the CellSet but does any necessary DBCP housekeeping, including calling the DBCP connection. I can't be sure unless I run this in a debugger.

@m-khl
Copy link
Author

m-khl commented Jun 3, 2014

@julianhyde I'm not sure what you mean in "please log one to we can track", I tried to raise an issue at Pentaho jira, but did find xmlaserver project.
please check #10 it bypasses MDDataSet.close() and hits the pool straight, it's how I've got your point. It might not be ideal way to fix, but my tests pass fine so far.

@julianhyde
Copy link
Member

Apologies; I was reading/replying via email, so I'd forgotten that we were in a github issue already. (This one!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants