Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5075338

Document removal of references to the object in getObjectInstance() method

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • None
    • 5.0
    • core-libs
    • None
    • Fix Understood
    • generic
    • generic

      javax.naming.spi.*ObjectFactory.getObjectInstance() method uses the obj parameter to construct the Object to be returned.
      The obj parameter must be cleared after it's use is over, i.e of creating an Object to be returned. Otherwise, it leads to resource leak.
      This must be documented either in the Javadoc or in the tutorial.

      A customer from Corio Inc was not closing the obj passed in as a DirContext instance in his ObjectFactory. That lead to socket leak because the connections from the DirContext to the LDAP server weren't released at all. He had opted for connection pooling and none of the connections could be reused as they were all in a busy state forever.

            jhangalsunw Jayalaxmi Hangal (Inactive)
            jhangalsunw Jayalaxmi Hangal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: