Class DaoFactoryPoolConfig

java.lang.Object
com.mcpdbwizard.pub.DaoFactoryPoolConfig

public class DaoFactoryPoolConfig extends Object
Sizing and lifetime settings for a DaoFactoryPool.

Generated code bakes in the values chosen at design time (the DAO_POOL_* config keys), then calls applyOverrides() so a deployment can retune without regenerating. Pool size is a property of where the code runs, not of the schema it was generated from — the same generated server may want 4 factories on a laptop and 40 in production.

Overrides are read from a system property first, then an environment variable. The environment variable names are exactly the config keys, so what appears in the .pb2/.json is what a container sets:

   DAO_POOL_MAX_SIZE          -Ddao.pool.maxSize
   DAO_POOL_MIN_IDLE          -Ddao.pool.minIdle
   DAO_POOL_MAX_WAIT_MS       -Ddao.pool.maxWaitMillis
   DAO_POOL_IDLE_TIMEOUT_MS   -Ddao.pool.idleTimeoutMillis
   DAO_POOL_ON_RETURN         -Ddao.pool.onReturn          (COMMIT | ROLLBACK)
   DAO_POOL_VALIDATE_ON_BORROW  -Ddao.pool.validateOnBorrow  (deployment-only, no config key)
 

A malformed or out-of-range override throws rather than silently falling back to the baked-in value: starting with a pool sized differently from what the operator asked for is worse than not starting. Copyright 2003-2026 ATB Consultancy Services Ltd (formerly Orinda Software Ltd, Dublin, Ireland)

  • Constructor Details

    • DaoFactoryPoolConfig

      public DaoFactoryPoolConfig()
      Defaults as documented on each field.
  • Method Details

    • applyOverrides

      public DaoFactoryPoolConfig applyOverrides()
      Overlay any settings supplied by the deployment, then validate. Generated code calls this after applying its baked-in design-time values.
      Returns:
      this config, for chaining
      Throws:
      IllegalArgumentException - if an override is unparseable, or if the resulting values are inconsistent
    • validateSettings

      public DaoFactoryPoolConfig validateSettings()
      Check the settings make sense together.
      Returns:
      this config, for chaining
      Throws:
      IllegalArgumentException - if they do not
    • getMaxSize

      public int getMaxSize()
    • setMaxSize

      public DaoFactoryPoolConfig setMaxSize(int maxSize)
    • getMinIdle

      public int getMinIdle()
    • setMinIdle

      public DaoFactoryPoolConfig setMinIdle(int minIdle)
    • getMaxWaitMillis

      public long getMaxWaitMillis()
    • setMaxWaitMillis

      public DaoFactoryPoolConfig setMaxWaitMillis(long maxWaitMillis)
    • getIdleTimeoutMillis

      public long getIdleTimeoutMillis()
    • setIdleTimeoutMillis

      public DaoFactoryPoolConfig setIdleTimeoutMillis(long idleTimeoutMillis)
    • isCommitOnReturn

      public boolean isCommitOnReturn()
    • setCommitOnReturn

      public DaoFactoryPoolConfig setCommitOnReturn(boolean commitOnReturn)
    • isValidateOnBorrow

      public boolean isValidateOnBorrow()
    • setValidateOnBorrow

      public DaoFactoryPoolConfig setValidateOnBorrow(boolean validateOnBorrow)
    • toString

      public String toString()
      Overrides:
      toString in class Object