XmlBlaster Logo



XmlBlaster Logo

Type NEW
Priority LOW
Topic XmlBlaster provides a 'named' JDBC connection pool for optimized performance of database access.

The JDBC pool allows accessing any number of different databases with arbitrary login users.
Every database user is separately pooled for maximum performance.

Every DB request needs to pass the DB-url, login name and password, since the clients are not permanently connected.

Unused connection pools are freed after some time, the timeout parameters and pool size is adjustable (see example below).

The connections are established on demand (lazy allocation).
Pre-allocation is currently not implemented.
The first SQL request (for example with Oracle) consumes about 1 second to establish the connection, the following requests get this connection from the pool, which is below 1 millisecond.
If many SQL requests are done simultaneously, the pool increases the number of parallel connections until 'maxInstances' is reached.
Further parallel connections would throw an exception.


These parameters allow to configure the JDBC pool behavior:

They can be set on command line or in the xmlBlaster.properties file.

Property Default / Example Description Implemented
JdbcPool.eraseUnusedPoolTimeout 60*60*1000L [msec] If a user disappears for one hour, delete his pool yes
JdbcPool.maxInstances 20 Max. number of simultaneous connections per user yes
JdbcPool.busyToIdleTimeout 0 [msec] Max. busy time of this resource in milli seconds.
On timeout it changes state from 'busy' to 'idle'.
You can overwrite this value for each resource instance
0 switches it off
-1 uses default (switched off)
You get called back through I_PoolManager.busyToIdle() on timeout allowing you to code some specific handling.
JdbcPool.idleToEraseTimeout 10*60*1000L [msec] Max. idle time span of this resource in milli seconds
An unused connection is shutdown after 10 min, freeing resources after peak usage
On timeout it changes state from 'idle' to 'undef' (it is deleted).
You can overwrite this value for each resource instance
0 switches it off
-1 uses default (10 min) (xmlBlaster.properties)
You get called back through I_PoolManager.toErased() on timeout allowing you to code some specific handling.
JdbcPool.maxResourceExhaustRetries 5 If pool is exhausted (all connections are busy) a new request tries the given number of times to get a connection from the pool, between the retries we sleep JdbcPool.resourceExhaustSleepGap times. yes
JdbcPool.resourceExhaustSleepGap 1000L [msec] How long to sleep between retries (see JdbcPool.maxResourceExhaustRetries) yes

NOTE: Configuration parameters are specified on command line (-someValue 17) or in the xmlBlaster.properties file (someValue=17). See requirement "util.property" for details.
Columns named Impl tells you if the feature is implemented.
Columns named Hot tells you if the configuration is changeable in hot operation.

See REQ engine.service.rdbms
See API org.xmlBlaster.protocol.jdbc.NamedConnectionPool
Testcase java org.xmlBlaster.protocol.jdbc.NamedConnectionPool

This page is generated from the requirement XML file xmlBlaster/doc/requirements/engine.service.rdbms.jdbcpool.xml

Back to overview