Uploaded image for project: 'Jahia Community'
  1. Jahia Community
  2. JAHIA-42

Cursor Leakage: JDBC ResultSets aren't closed in many source files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • xCM 4.3
    • WCM 4.0
    • None
    • Operating System: All
      Platform: All

    Description

      In Jahia's core code, as well as the Time reporting application, and probably
      other locations, JDBC ResultSet objects aren't closed after use. Since a
      connection pool is used, the connections don't get closed quickly, so the number
      of open resultsets grows and grows. In Oracle, this translates directly into
      open cursors, and open cursors are a limited resource in Oracle. So after a
      not-too-long while, errors like these bring down Jahia:

      java.sql.SQLException: ORA-01000: maximum open cursors exceeded

      at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
      at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
      at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:120)
      at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:586)
      at oracle.jdbc.driver.OracleStatement.<init>(OracleStatement.java:385)
      at
      oracle.jdbc.driver.OracleConnection.privateCreateStatement(OracleConnection.java:772)
      at oracle.jdbc.driver.OracleConnection.createStatement(OracleConnection.java:712)
      at com.mycomponents.webapps.timereporting.DBServices.executeQuery(DBServices.java:71)
      at
      com.mycomponents.webapps.timereporting.DBServices.createProject(DBServices.java:893)
      at
      com.mycomponents.webapps.timereporting.TimeReportingServlet.doPost(TimeReportingServlet.java:284)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

      I believe that fixing this requires a complete audit of the Jahia code to find
      all occurrences of unclosed resultsets. A workaround is to disable the
      connection pool, so that connections are closed immediately. This makes Jahia
      much slower.

      TestRail: Results

        Attachments

          Activity

            People

              ktlili Khaled Tlili (Inactive)
              erwin.bolwidt@marviq.com Erwin Bolwidt
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                TestRail: Runs

                  TestRail: Cases

                    Packages

                      Version Package
                      xCM 4.3