glassfish
  1. glassfish
  2. GLASSFISH-11369

The feature to disable connection pooling has no effect.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: V3
    • Fix Version/s: V3
    • Component/s: jdbc
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      11,369

      Description

      When I use a pool that has been disabled connection pooling,
      I also can see some free pools by monitor.

      To find the cause, I do some research in the SRC.And find some points.

      connectors\connectors-runtime\src\main\java\com\sun\enterprise\resource\pool\ResourcePoolFactoryImpl.java
      Line 73,74
      if( pt == PoolType.POOLING_DISABLED ) {
      return new UnpooledResource( poolName );
      }
      When poolType is PoolType.POOLING_DISABLED, the ResourcePool will be
      UnpooledResource. It's OK.

      But there is a problem in getting a poolType for ConnectionPool. It seems that
      the poolType will never be PoolType.POOLING_DISABLED.
      connectors\connectors-runtime\src\main\java\com\sun\enterprise\connectors\service\ConnectorConnectionPoolAdminServiceImpl.java
      Line: 1039-1047
      private PoolType getPoolType(ConnectorConnectionPool connectorConnectionPool) {
      PoolType pt = PoolType.STANDARD_POOL;
      if (connectorConnectionPool.isAssociateWithThread())

      { pt = PoolType.ASSOCIATE_WITH_THREAD_POOL; } else if (connectorConnectionPool.isPartitionedPool()) { pt = PoolType.PARTITIONED_POOL; }
      return pt;
      }

      I think the right src should be like this:
      private PoolType getPoolType(ConnectorConnectionPool connectorConnectionPool) {
      PoolType pt = PoolType.STANDARD_POOL;
      if (connectorConnectionPool.isPoolingOn()) { pt = PoolType.POOLING_DISABLED; } else
      if (connectorConnectionPool.isAssociateWithThread()) { pt = PoolType.ASSOCIATE_WITH_THREAD_POOL; }

      else if (connectorConnectionPool.isPartitionedPool())

      { pt = PoolType.PARTITIONED_POOL; }

      return pt;
      }

        Activity

        Hide
        zhaojianyong added a comment -

        Sorry. There is a problem in above "rigth src".
        The "right src" should be like this:
        private PoolType getPoolType(ConnectorConnectionPool connectorConnectionPool) {
        PoolType pt = PoolType.STANDARD_POOL;
        if (!connectorConnectionPool.isPoolingOn())

        { pt = PoolType.POOLING_DISABLED; }

        else
        if (connectorConnectionPool.isAssociateWithThread())

        { pt = PoolType.ASSOCIATE_WITH_THREAD_POOL; }

        else if (connectorConnectionPool.isPartitionedPool())

        { pt = PoolType.PARTITIONED_POOL; }

        return pt;
        }

        Show
        zhaojianyong added a comment - Sorry. There is a problem in above "rigth src". The "right src" should be like this: private PoolType getPoolType(ConnectorConnectionPool connectorConnectionPool) { PoolType pt = PoolType.STANDARD_POOL; if (!connectorConnectionPool.isPoolingOn()) { pt = PoolType.POOLING_DISABLED; } else if (connectorConnectionPool.isAssociateWithThread()) { pt = PoolType.ASSOCIATE_WITH_THREAD_POOL; } else if (connectorConnectionPool.isPartitionedPool()) { pt = PoolType.PARTITIONED_POOL; } return pt; }
        Hide
        zhaojianyong added a comment -

        In "Sun GlassFish Enterprise Server v3 Application Development Guide", 246 page:
        =================================================================================
        A warning is logged if the following attributes are used, because they are
        useful only in a pooled environment:
        â–  connection-validation
        â–  validate-atmost-once-period
        â–  match-connections
        â–  max-connection-usage
        â–  idle-timeout
        ================================================================================

        I think the following attributes also are useful only in a pooled environment:
        ================================================================================
        â–  Initial and Minimum Pool Size
        â–  Pool Resize Quantity
        ================================================================================

        Show
        zhaojianyong added a comment - In "Sun GlassFish Enterprise Server v3 Application Development Guide", 246 page: ================================================================================= A warning is logged if the following attributes are used, because they are useful only in a pooled environment: â–  connection-validation â–  validate-atmost-once-period â–  match-connections â–  max-connection-usage â–  idle-timeout ================================================================================ I think the following attributes also are useful only in a pooled environment: ================================================================================ â–  Initial and Minimum Pool Size â–  Pool Resize Quantity ================================================================================
        Hide
        Shalini added a comment -

        Fixing this issue by returning the right pool type for a pooling disabled case.

        Also, the case when flush connection pool is executed when pooling is disabled
        is a case that should not be supported. Adding a validation for the same.

        Sending
        connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/ConnectorConnectionPoolAdminServiceImpl.java
        Sending
        connectors/connectors-runtime/src/main/resources/com/sun/enterprise/connectors/service/LocalStrings.properties
        Sending
        connectors/connectors-runtime/src/main/resources/com/sun/logging/enterprise/resource/resourceadapter/LogStrings.properties
        Transmitting file data ...
        Committed revision 35185.

        Show
        Shalini added a comment - Fixing this issue by returning the right pool type for a pooling disabled case. Also, the case when flush connection pool is executed when pooling is disabled is a case that should not be supported. Adding a validation for the same. Sending connectors/connectors-runtime/src/main/java/com/sun/enterprise/connectors/service/ConnectorConnectionPoolAdminServiceImpl.java Sending connectors/connectors-runtime/src/main/resources/com/sun/enterprise/connectors/service/LocalStrings.properties Sending connectors/connectors-runtime/src/main/resources/com/sun/logging/enterprise/resource/resourceadapter/LogStrings.properties Transmitting file data ... Committed revision 35185.

          People

          • Assignee:
            Shalini
            Reporter:
            zhaojianyong
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: