Uploaded image for project: 'Commons Pool'
  1. Commons Pool
  2. POOL-209

SharedPoolDataSource does not handle null keys correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • None
    • None
    • None
    • Windows, java version "1.6.0_06", Torque 3.3 (DBCP 1.4, jTDS 1.2.5)

    Description

      GenericKeyedObjectPool.borrowObject does not invalidate object if validateObject fails (line ~1200). I guess invalidation would be needed for objects which are not newly created (newlyCreated flag in the code).

      Scenario:
      1.) DB connection put into pool
      2.) Attempt to reuse connection (borrowObject)
      3.) Test on borrow (executing simple SQL query) fails: DB connection closed on jTDS level but connection remains in the pool
      4.) Subsequent attempts to reuse the connection causes "java.sql.SQLException: Invalid state, the Connection object is closed"

      Attachments

        1. GenericKeyedObjectPool.java
          111 kB
          Gabor Horvath

        Activity

          People

            Unassigned Unassigned
            horvgab Gabor Horvath
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: