Details

    • Type: Patch Patch
    • Status: Resolved
    • Priority: 2 Major 2 Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.5
    • Fix Version/s: 2.2
    • Component/s: JDBC JobStores
    • Labels:
      None
    • Terracotta Target:
      Vicente_Holding
    • Fixed In Revision:
      2275

      Description

      StdJDBCDelegate fails to free its blobs in getObjectFromBlob and getJobDataFromBlob.

      The ResultSet API explicitely says that closing the ResultSet won't free the Blob :

      "The closing of a ResultSet object does not close the Blob, Clob or NClob objects created by the ResultSet. Blob, Clob or NClob objects remain valid for at least the duration of the transaction in which they are creataed, unless their free method is invoked."

      Most JDBC implementations will free the resources at the end of the transaction, but notice the API says "at least the duration of the transaction", not at most...
      Using for example CachéDB, not freeing the blobs results in stuck resources.

      Proposed patch encloses calls to rs.getBlob in try / catch and call blob.free() in finally, to explicitely release the resources of the blobs.

        Activity

        Hide
        James House added a comment -

        this patch screws up some databases, such as derby...

        Show
        James House added a comment - this patch screws up some databases, such as derby...
        Hide
        Chris Dennis added a comment -

        I've modified CacheDelegate to correctly free Blob instances. I decided against modifying StdJDBCDelegate to avoid potential breakage for other databases.

        I don't have immediate access to a Caché installation to test against - if you could verify this fix for me that would be great. If thats not possible, I'll see what I can do later about verifying it myself.

        Show
        Chris Dennis added a comment - I've modified CacheDelegate to correctly free Blob instances. I decided against modifying StdJDBCDelegate to avoid potential breakage for other databases. I don't have immediate access to a Caché installation to test against - if you could verify this fix for me that would be great. If thats not possible, I'll see what I can do later about verifying it myself.

          People

          • Assignee:
            Franck Routier
            Reporter:
            Franck Routier
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: