Class DaoFactoryPoolConfig
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionOverlay any settings supplied by the deployment, then validate.longintlongintbooleanbooleansetCommitOnReturn(boolean commitOnReturn) setIdleTimeoutMillis(long idleTimeoutMillis) setMaxSize(int maxSize) setMaxWaitMillis(long maxWaitMillis) setMinIdle(int minIdle) setValidateOnBorrow(boolean validateOnBorrow) toString()Check the settings make sense together.
-
Constructor Details
-
DaoFactoryPoolConfig
public DaoFactoryPoolConfig()Defaults as documented on each field.
-
-
Method Details
-
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
Check the settings make sense together.- Returns:
- this config, for chaining
- Throws:
IllegalArgumentException- if they do not
-
getMaxSize
public int getMaxSize() -
setMaxSize
-
getMinIdle
public int getMinIdle() -
setMinIdle
-
getMaxWaitMillis
public long getMaxWaitMillis() -
setMaxWaitMillis
-
getIdleTimeoutMillis
public long getIdleTimeoutMillis() -
setIdleTimeoutMillis
-
isCommitOnReturn
public boolean isCommitOnReturn() -
setCommitOnReturn
-
isValidateOnBorrow
public boolean isValidateOnBorrow() -
setValidateOnBorrow
-
toString
-