Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-3596

Creation of logical connections from a pooled connection causes resource leak on the server

    XMLWordPrintableJSON

Details

    • Performance

    Description

      When using ClientConnectionPoolDataSource and connection pooling, a new connection / transaction is created for every new logical connection, and the resources are not freed / cleaned up in the server. They are not even cleaned up when the physical connection (ClientPooledConnection) is closed.
      A logical connection is obtained by invoking ClientPooledConnection.getConnection().

      I have observed that if you run the repro enough times against the same server, the number of transaction in the transaction table will be reduced now and then. I believe this is garbage collection, but I have not investigated the problem enough to tell for sure what's going on.

      I have also seen some locks not being freed, causing timeouts in some applications. I don't have a repro for the lock problem at this time, but it is very likely related to this issue.

      Note that XA connections are handled differently on the server, and do probably not have this problem.

      Attachments

        1. ConnectionPoolingBug.java
          3 kB
          Kristian Waagan
        2. derby-3596-2a-simple_approach.diff
          0.6 kB
          Kristian Waagan
        3. derby-3596-1a-complex_approach.diff
          9 kB
          Kristian Waagan
        4. nofix-heap.png
          63 kB
          Kristian Waagan
        5. simple-fix-heap.png
          75 kB
          Kristian Waagan
        6. complex-fix-heap.png
          73 kB
          Kristian Waagan
        7. derby-3596-3a-test_cleanup.diff
          3 kB
          Kristian Waagan
        8. derby-3596-1b-complex_approach.diff
          5 kB
          Kristian Waagan
        9. derby-3596-4a-complex_check_creds.diff
          10 kB
          Kristian Waagan
        10. derby-3596-5a-complex_skip_creds.diff
          8 kB
          Kristian Waagan
        11. derby-3596-5a-complex_skip_creds.diff
          8 kB
          Kristian Waagan

        Issue Links

          Activity

            People

              kristwaa Kristian Waagan
              kristwaa Kristian Waagan
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: