glassfish
  1. glassfish
  2. GLASSFISH-17433

Maximum-pool-size is involved in the behavior of unpooled connections

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: jdbc
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      Maximum-pool-size in pool settings is described on GlassFish Server Administration Console Reference below.

      The maximum number of connections in the pool. The default value is 32.
      

      However this functionality always sets an upper limit to the number of connections regardless of the pooling attribute value which is enabled or disabled although almost any other attributes such as initial-and-minimum-pool-size has no effect on unpooled connections.

      I think this spec may confuse users and can be a frequent cause of incorrect use. It is because the more likely scenario where unpooled mode will be selected is the case a user would like to use connections pooled by a JDBC driver. In this case, not only a JDBC driver but also an application server redundantly restricts the connection size by default due to the default value of maximum-pool-size(32).

      I would like to confirm the reason why maximum-pool-size is effective on even unpooled mode. Besides, I believe we should avoid adopting an option which lets users change maximum-pool-size manually so that they can make sure maximum-pool-size is greater than the upper limit set on the JDBC driver. I think it difficult for users to understand the relationship between maximum-pool-size and unpooled mode.

      Therefore I would suggest either one of the following improvements if it is acceptable.
      1. Remove the corresponding codes controlling the maximum size of connections when the pooling attribute is specified as disabled.

      com.sun.enterprise.resource.pool.UnpooledResource.java
             private synchronized boolean incrementPoolSize(){
              if(poolSize >= maxPoolSize) // These are the condition
                  return false;           // for maximum-pool-size.
              poolSize++;
              return true;
          }
      

      2. Prepare a value of maximum-pool-size which allows users to create unlimited connections and switch to this special value automatically when the pooling attribute is specified as disabled. They can also specify another value as maximum-pool-size consciously afterwards if needed.

        Activity

        Hide
        Shalini added a comment -

        Though the names (steady-pool-size/max-pool-size) may sound
        inappropriate for the "pooling=false" option, these are used to limit
        the concurrent number of connections usage ie., a pool can serve upto
        "max-pool-size" number of connections at any point in time. We do not
        allow unlimited connections to be acquired as that can potentially bring
        down the entire DB/EIS server.

        We could come up with a better naming mechanism for steady-pool-size and max-pool-size when connection pooling is turned off.

        Show
        Shalini added a comment - Though the names (steady-pool-size/max-pool-size) may sound inappropriate for the "pooling=false" option, these are used to limit the concurrent number of connections usage ie., a pool can serve upto "max-pool-size" number of connections at any point in time. We do not allow unlimited connections to be acquired as that can potentially bring down the entire DB/EIS server. We could come up with a better naming mechanism for steady-pool-size and max-pool-size when connection pooling is turned off.

          People

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

            Dates

            • Created:
              Updated: