Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-1372

Fix resource leaks in various classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      Statement / PreparedStatement should be closed after query completes.
      Below is an example of resource leak from MetaDataUtil#deleteViewIndexSequences():

           public static void deleteViewIndexSequences(PhoenixConnection connection, PName name) throws SQLException {
               SequenceKey key = getViewIndexSequenceKey(null, name);
              connection.createStatement().executeUpdate("DELETE FROM " + PhoenixDatabaseMetaData.SEQUENCE_TABLE_NAME +
      

      The Statement created by connection.createStatement() should be closed upon return.

      Attachments

        1. 1372-v1.txt
          17 kB
          Ted Yu

        Issue Links

          Activity

            People

              yuzhihong@gmail.com Ted Yu
              yuzhihong@gmail.com Ted Yu
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: