Anvil | Smiths Smiths | Register Register | Login Login |
Search:
Show links Show tools Hide tree | Previous document Next document | njet.org > Anvil > Documentation > Configuration > pool

pool

Pool controls (generic) database connection pooling.

Attributes
name default description
name N/A Name of pool. Used when pool is acquired with anvil.sql.acquire().
factory this Classname of factory creating the ConnectionImpl instances. Factory must implement the interface anvil.database.ConnectionFactory. See Providers.
monitor this Monitor implementing anvil.database.ConnectionMonitor. Receives notification about events concerning the usage of pool. Default monitor merely logs the actions.
min 0 Minimum amount of connections always kept ready.
max 10 Maximum amount of connections opened to this data source at any time.
lifetime 600 Lifetime of connections, in seconds. When reached, the connection is closed, unless it is being currently used.
timeout 60 Timeout in seconds, after which the reserver is considered dead and the reserved connection is closed.
checktimeout 5 Timeout between checking connections. Checking also occurs automatically if reserve or release events happens.
acquiretimeout 5000 Timeout to wait when acquiring the connection, in milliseconds. If connection could not be established and returned before timeout CannotReturnConnectionImplException is thrown.
driver N/A Classname of driver (factory specific).
url N/A Connection URL (factory specific).
username N/A Username (factory specific).
password N/A Password (factory specific).
* * Any attributes required by the custom provider.

Example:
  pool:
    name = msg_forum
    driver = org.gjt.mm.mysql.Driver
    url = jdbc:mysql://my.domain.com/msg_forum
    username = usr
    password = pwd
    min = 0
    max = 5
    lifetime = 600
    timeout = 60
    checktimeout = 5
    acquiretimeout = 5000
  end

See also  | Configuration  | Providers  | Anvil features  | LDAPRealm  | DBRealm
Contributes notes:
Add a note
What's new | Anvil