Uploaded image for project: 'Commons Dbcp'
  1. Commons Dbcp
  2. DBCP-273

validation on testonborrow does not work

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1, 1.2.2
    • Fix Version/s: 1.3, 1.4
    • Labels:
      None

      Description

      Our use of dbcp (1.2.1 and 1.2.2) shows that connection validation on testonborrow does not work. The pool still return closed connections. The error is in the following code. See the commented out line for the specific error.
      ----------------------
      ra = ref.get("testOnBorrow");
      if (ra != null && ra.getContent() != null)

      { //comment out old code //ikds.setTestOnBorrow(Boolean.getBoolean(ra.getContent().toString())); ikds.setTestOnBorrow(Boolean.valueOf(ra.getContent().toString()).booleanValue()); }

      ra = ref.get("testOnReturn");
      if (ra != null && ra.getContent() != null)

      { ikds.setTestOnReturn(Boolean.valueOf( ra.getContent().toString()).booleanValue()); }

        Activity

        Hide
        srempfer Stefan Rempfer added a comment -

        Class: InstanceKeyObjectFactory
        Revision: 479137
        Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006)
        Method: private void setCommonProperties(Reference ref, InstanceKeyDataSource ikds)
        Line: 175

        Code-Snipped:

        Bug:
        ---------

        ra = ref.get("testOnBorrow");
        if (ra != null && ra.getContent() != null)

        { ikds.setTestOnBorrow( Boolean.getBoolean(ra.getContent().toString())); }

        Solution:
        ------------

        ra = ref.get("testOnBorrow");
        if (ra != null && ra.getContent() != null)

        { ikds.setTestOnBorrow( Boolean.valueOf(ra.getContent().toString())); }
        Show
        srempfer Stefan Rempfer added a comment - Class: InstanceKeyObjectFactory Revision: 479137 Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) Method: private void setCommonProperties(Reference ref, InstanceKeyDataSource ikds) Line: 175 Code-Snipped: Bug: --------- ra = ref.get("testOnBorrow"); if (ra != null && ra.getContent() != null) { ikds.setTestOnBorrow( Boolean.getBoolean(ra.getContent().toString())); } Solution: ------------ ra = ref.get("testOnBorrow"); if (ra != null && ra.getContent() != null) { ikds.setTestOnBorrow( Boolean.valueOf(ra.getContent().toString())); }
        Hide
        psteitz Phil Steitz added a comment -

        Fixed in r737481.

        Used old (<=1.4) method to preserve compatability.

        Thanks!

        Show
        psteitz Phil Steitz added a comment - Fixed in r737481. Used old (<=1.4) method to preserve compatability. Thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            marklsenior mark lin
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development