glassfish
  1. glassfish
  2. GLASSFISH-16007

JDBC Pools: Load Defaults does not load default values for resource type

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1_b43
    • Fix Version/s: 3.1.1, 4.0
    • Component/s: admin_gui
    • Labels:
      None
    • Environment:

      promoted build b43

      Description

      Steps to reproduce:

      1. Go to JDBC Connection Pools and click on DerbyPool.
      2. Modify Resource Type to e.g. java.sql.Driver, and enter some bogus Driver Classname. Note that Datasource Classname field got cleared. Save changes.
      3. Go again to the DerbyPool and click on Load Defaults - Issue 1: default values for Resource Type and Datasource Classname are not brought back.
      4. Change Resource Type back to javax.sql.DataSource and click Save. The following error is displayed:

      An error has occurred
      Check server log for more information.

      Server log contains:

      [#|2011-02-16T10:28:50.343-0800|SEVERE|oracle-glassfish3.1|org.glassfish
      .admingui|_ThreadID=23;_ThreadName=Thread-1;|updateEntity failed. parent='http:
      //localhost:4848/management/domain/resources/jdbc-connection-pool/DerbyPool'; at
      trs ='

      {idleTimeoutInSeconds=300, transactionIsolationLevel=, driverClassname=ouc h.now, steadyPoolSize=8, nonTransactionalConnections=null, maxPoolSize=32, descr iption=null, datasourceClassname=, name=DerbyPool, maxWaitTimeInMillis=60000, po olResizeQuantity=2, ping=null, resType=javax.sql.DataSource, isIsolationLevelGua ranteed=true}

      '|#]

      Issue 2: The above does not mention the reason why the Save/Update action failed. We need to communicate this to user.

      1. server.log
        1.0 kB
        lidiam
      1. jdbcpool-update-error.JPG
        173 kB

        Activity

        Hide
        Anissa Lam added a comment -

        Would like to see this fix for 3.1.1.

        Show
        Anissa Lam added a comment - Would like to see this fix for 3.1.1.
        Hide
        sumasri added a comment -

        1)Update was failing because of the absence of class name while saving the values. This can be resolved by adding a check from GUI side to verify the presence of class name before saving the pool values.
        2)There is no default value for resource type. Hence, it is not loading the value after clicking on Load defaults button.

        Show
        sumasri added a comment - 1)Update was failing because of the absence of class name while saving the values. This can be resolved by adding a check from GUI side to verify the presence of class name before saving the pool values. 2)There is no default value for resource type. Hence, it is not loading the value after clicking on Load defaults button.
        Hide
        sumasri added a comment -

        Why fix this issue in 3.1.1?
        o If data source or driver class name is not present, update is failing.

        Which is the targeted build of 3.1.1 for this fix?
        o MS4

        Do regression tests exist for this issue?
        o No. Manual testing should be sufficient

        Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
        o verify the bug reported is fixed

        Diffs:

        Index: jdbc/src/main/resources/jdbcConnectionPoolEditButtons.inc
        ===================================================================
        — jdbc/src/main/resources/jdbcConnectionPoolEditButtons.inc (revision 47043)
        +++ jdbc/src/main/resources/jdbcConnectionPoolEditButtons.inc (working copy)
        @@ -45,7 +45,7 @@
        <!facet pageButtonsTop>
        <sun:panelGroup id="topButtons">
        <sun:button id="saveButton" rendered="#

        {edit}

        " text="$resource

        {i18n.button.Save}

        "

        • onClick="if (guiValidate('# {reqMsg}','#{reqInt}','#{reqPort}')) {submitAndDisable(this, '$resource{i18n.button.Processing}');}; return false;" >
          + onClick="if (isClassNamePresent('$resource{i18njdbc.msg.Error.classNameCannotBeEmpty}') && guiValidate('#{reqMsg}

          ','#

          {reqInt}

          ','#

          {reqPort}

          '))

          Unknown macro: {submitAndDisable(this, '$resource{i18n.button.Processing}');}

          ; return false;" >
          <!command
          gf.updateEntity(endpoint="#

          {pageSession.resourceUrl}

          "
          attrs="#

          {pageSession.valueMap}

          "
          Index: jdbc/src/main/resources/jdbcConnectionPoolEdit.jsf
          ===================================================================

            • jdbc/src/main/resources/jdbcConnectionPoolEdit.jsf (revision 47043)
              +++ jdbc/src/main/resources/jdbcConnectionPoolEdit.jsf (working copy)
              @@ -140,14 +140,33 @@
              }
              function disableEnableFields(type) {
              if(type == 'java.sql.Driver')
              Unknown macro: {+ var val = document.getElementById("$pageSession{dsTextField}").value;
              disableComponent("$pageSession{dsTextField}", 'text');+ document.getElementById("$pageSession{dsTextField}").value = val;
              enableComponent("$pageSession{ddsTextField}", 'text');
              } else{
              enableComponent("$pageSession{dsTextField}", 'text');+ var val = document.getElementById("$pageSession{ddsTextField}").value;
              disableComponent("$pageSession{ddsTextField}", 'text');+ document.getElementById("$pageSession{ddsTextField}").value = val;
              }
              }

              + function isClassNamePresent(reqMsg) {
              + var resType = document.getElementById("$pageSession{resTypeVal}").value;
              + var className = '';
              + if (resType == 'java.sql.Driver') {
              + className = document.getElementById("$pageSession{ddsTextField}").value;+ }

              else

              Unknown macro: {+ className = document.getElementById("$pageSession{dsTextField}").value;+ }

              + if (className == null || className == '')

              { + showAlert(reqMsg); + return false; + }

              + return true;
              + }
              +
              </script>
              </f:verbatim>

        Show
        sumasri added a comment - Why fix this issue in 3.1.1? o If data source or driver class name is not present, update is failing. Which is the targeted build of 3.1.1 for this fix? o MS4 Do regression tests exist for this issue? o No. Manual testing should be sufficient Which tests should QA (re)run to verify the fix did not destabilize GlassFish? o verify the bug reported is fixed Diffs: Index: jdbc/src/main/resources/jdbcConnectionPoolEditButtons.inc =================================================================== — jdbc/src/main/resources/jdbcConnectionPoolEditButtons.inc (revision 47043) +++ jdbc/src/main/resources/jdbcConnectionPoolEditButtons.inc (working copy) @@ -45,7 +45,7 @@ <!facet pageButtonsTop> <sun:panelGroup id="topButtons"> <sun:button id="saveButton" rendered="# {edit} " text="$resource {i18n.button.Save} " onClick="if (guiValidate('# {reqMsg}','#{reqInt}','#{reqPort}')) {submitAndDisable(this, '$resource{i18n.button.Processing}');}; return false;" > + onClick="if (isClassNamePresent('$resource{i18njdbc.msg.Error.classNameCannotBeEmpty}') && guiValidate('#{reqMsg} ','# {reqInt} ','# {reqPort} ')) Unknown macro: {submitAndDisable(this, '$resource{i18n.button.Processing}');} ; return false;" > <!command gf.updateEntity(endpoint="# {pageSession.resourceUrl} " attrs="# {pageSession.valueMap} " Index: jdbc/src/main/resources/jdbcConnectionPoolEdit.jsf =================================================================== jdbc/src/main/resources/jdbcConnectionPoolEdit.jsf (revision 47043) +++ jdbc/src/main/resources/jdbcConnectionPoolEdit.jsf (working copy) @@ -140,14 +140,33 @@ } function disableEnableFields(type) { if(type == 'java.sql.Driver') Unknown macro: {+ var val = document.getElementById("$pageSession{dsTextField}").value; disableComponent("$pageSession{dsTextField}", 'text');+ document.getElementById("$pageSession{dsTextField}").value = val; enableComponent("$pageSession{ddsTextField}", 'text'); } else{ enableComponent("$pageSession{dsTextField}", 'text');+ var val = document.getElementById("$pageSession{ddsTextField}").value; disableComponent("$pageSession{ddsTextField}", 'text');+ document.getElementById("$pageSession{ddsTextField}").value = val; } } + function isClassNamePresent(reqMsg) { + var resType = document.getElementById("$pageSession{resTypeVal}").value; + var className = ''; + if (resType == 'java.sql.Driver') { + className = document.getElementById("$pageSession{ddsTextField}").value;+ } else Unknown macro: {+ className = document.getElementById("$pageSession{dsTextField}").value;+ } + if (className == null || className == '') { + showAlert(reqMsg); + return false; + } + return true; + } + </script> </f:verbatim>
        Hide
        scatari added a comment -

        Approved for 3.1.1.

        Show
        scatari added a comment - Approved for 3.1.1.
        Hide
        Anissa Lam added a comment -

        Change looks good. Please check into both trunk & 3.1.1 branch.

        Show
        Anissa Lam added a comment - Change looks good. Please check into both trunk & 3.1.1 branch.
        Hide
        sumasri added a comment -

        checked in to both trunk and branch 3.1.1

        Show
        sumasri added a comment - checked in to both trunk and branch 3.1.1
        Hide
        shaline added a comment -

        Verified on GF 3.1.1 nightly dated 06/24.

        Show
        shaline added a comment - Verified on GF 3.1.1 nightly dated 06/24.
        Hide
        Anissa Lam added a comment -

        re-open issue to add the 'fixed version' field.

        Show
        Anissa Lam added a comment - re-open issue to add the 'fixed version' field.
        Hide
        Anissa Lam added a comment -

        change back to closed status.

        Show
        Anissa Lam added a comment - change back to closed status.

          People

          • Assignee:
            sumasri
            Reporter:
            lidiam
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: