Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: Closing JDBC Connections

  1. #1
    Join Date
    May 2003
    Posts
    15

    Default Closing JDBC Connections

    How does Mondrian close its jdbc connection? We have found a number of connections remaining open from Mondrian. Does Mondrian close them or let the session termination/timeout kill them? Also, does Mondrian automatically close the connection if an exception is thrown somewhere throughout building a pivot table? Thanks.

  2. #2
    Join Date
    Nov 1999
    Posts
    1,618

    Default RE: Closing JDBC Connections

    No. There has been a discussion about this issue on the mondrian-devel list, and RFE 764169 [https://sourceforge.net/tracker/inde...2&atid=414616] was raised.

  3. #3
    Join Date
    Oct 2004
    Posts
    8

    Default RE: Closing JDBC Connections

    I saw that the mentioned RFE has been closed.
    But still we have the problem that JDBC connections increase with each olap.DriverManager.getConnection() and seem to not be closed even though Connection.close() is called. I had a look into class RolapConnection (which I assume is the currently used implementation of mondrian.olap.Connection) and saw that the close() method has an empty body. Does that mean that calling close() is without effect right now?
    Is there another way to close pending JDBC connections?
    Thanks a lot for help!

  4. #4
    Join Date
    Oct 2004
    Posts
    8

    Default RE: Closing JDBC Connections

    I recognized after several tests that is was NOT Mondrian that opened all the DB-connections.
    So, no blame on Mondrian ;-)

  5. #5
    Join Date
    Oct 2004
    Posts
    8

    Default RE: Closing JDBC Connections

    I recognized after several tests that is was NOT Mondrian that opened all the DB-connections.
    So, no blame on Mondrian ;-)

  6. #6
    Join Date
    Jun 2004
    Posts
    26

    Default RE: Closing JDBC Connections

    We are working on this task too. Indeed, it's not great when you have almost 2000 users.
    Do you have some results of your search ? We are tracing connections and it doesn't seem easy to change the code.

  7. #7
    Join Date
    Nov 1999
    Posts
    1,618

    Default RE: Closing JDBC Connections

    sfm93,
    omaass stated that his problem was with his application leaking mondrian.olap.Connection objects (which are not JDBC connections).
    Mondrian gets its connections from a JDBC connection pool and, as far as I know, releases connections back to the pool in all circumstances.
    Please clarify your problem.

  8. #8
    Join Date
    Jun 2004
    Posts
    26

    Default RE: Closing JDBC Connections

    Julian,
    Insofar as the "close" method is never defined, the connection cannot be released as long as the user is connected. Thus, the connection is blocked and cannot be divided thanks to the pool.
    Why rather not use the pool of the application' server (like tomcat) than to redefine one ?

  9. #9
    Join Date
    Nov 1999
    Posts
    1,618

    Default RE: Closing JDBC Connections

    I think we're at cross-purposes here.
    Mondrian connections are NOT JDBC connections. (Since Mondrian is not an SQL database.)
    Mondrian connections do not hold very many resources, so we leave it to the garbage-collector to free them. I guess I could add a close() method, but it wouldn't do anything.
    Of course Mondrian uses JDBC connections under the covers in order to get its data. These connections are managed by a connection pool, just as you suggest. They are used for brief periods of time during Mondrian requests, and are then released back to the pool, regardless of whether the JDBC request or the Mondrian request has an error.

  10. #10
    Join Date
    Jun 2004
    Posts
    26

    Default RE: Closing JDBC Connections

    Sorry, you were right entirely.
    Our problem wasn't a mondrian problem but another connection.
    The fact that mondrian's connection is defined in static makes it possible to divide it and closing is in this case superfluous.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.