Data Source Configuration on JBoss WildFly Application Server

With Java EE6, the new annotation @Data SourceDefinition enables you to configure a data source directly from within their application.

A data source is a Java Naming and Directory Interface (JNDI) object used to obtain a connection from a connection pool to a database.

You can set the data source configurations at the following locations:

  • JBoss WildFly : Edit the standalone.xml file located in the $JBOSS_HOME\standalone\configuration directory.

Consider setting the following parameters in the data source configuration file for performance tests:

<min-pool-size>100</min-pool-size>
<max-pool-size>500</max-pool-size>
<blocking-timeout-millis>30000</blocking-timeout-millis>
  • min-pool-size: specifies the minimum number of connections a pool should hold. These pool instances are not created until an initial request for a connection is made. The default is 0.
  • max-pool-size: specifies the maximum number of connections for a pool. The max-pool-size number of connections is the maximum that is created in a pool. The default is 20.
  • blocking-timeout-millis: specifies the maximum time in milliseconds to block while waiting for a connection before throwing an exception. Note that this blocks only while waiting for a permit for a connection, and never throws an exception if creating a new connection takes an inordinately long time. The default is 5000.