DB Query resource adaptor configuration
You configure the DB Query resource adaptor using SLEE profiles. A single configuration property is used to point
to a master configuration profile for the resource adaptor entity. This configuration profile in turn references a
number of other profiles that configure the datasources. For each datasource configuration profile specified, the
resource adaptor will create a DataSource
object using the given class name, then set the other profile attributes as
datasource properties.
To configure DB Query resource adaptor entities, use the following types of resource adaptor configuration:
-
Elements of the Datasource properties profile attribute array
-
Per-node configuration when nodes in a cluster require different configurations.
And see the configuration example, which sets up two different datasource configurations.
You should set a network timeout to avoid possible long or indefinite waiting for a response from the database in the event of a network or database failure. See Network timeout configuration. |
Resource adaptor configuration properties
The DB Query resource adaptor has the following resource adaptor configuration properties:
Name | Type | Description |
---|---|---|
|
|
The name of the profile to configure this resource adaptor entity |
|
|
Flag to indicate that per-node configuration profiles should be used (see details below) |
|
|
Enables improved RA behaviour under overload conditions by caching results and closing all resources immediately |
Resource adaptor configuration profile
The DbQueryConfigProfile
profile has the following attributes:
Name | Type | Description |
---|---|---|
|
ProfileID[] |
List of DataSource profiles. These will always be tried in the order given. |
|
String |
An SQL statement to be executed against the datasources to test for availability |
|
long (ms) |
Time between polling for changes to datasource profiles |
|
long (ms) |
Maximum time a synchronous transaction can exist before assuming the service has neglected to end it and it is marked as 'lost' |
|
long (ms) |
Maximum time a transaction will stay in the 'lost' transaction list before being forcibly ended |
|
long (ms) |
Time between scanning sync and lost transactions |
Datasource configuration profiles
The DbQueryDataSourceProfile
profile has the following attributes:
Name | Type (units) | Description |
---|---|---|
|
String |
A description for this datasource, will be used in log messages and statistics parameter set names |
|
boolean |
Flag to enable/disable this datasource administratively |
|
String |
The Java class name for the datasource, will be instantiated via reflection |
|
String |
Value for the |
|
String |
Value for the |
|
String |
Value for the |
|
String |
Value for the ServerName property if used by this datasource (not needed if |
|
int |
Value for the PortNumber property if used by this datasource (not needed if |
|
String |
Value to be passed to the |
|
String |
Value to be passed to the |
|
String |
Value for the DatabaseName property if used by this datasource (not needed if |
|
String[] |
Arbitrary values to be passed to |
|
String |
Properties to be passed to the |
|
long (ms) |
Timeout for a query, including getting a connection, preparing and executing the statement. On |
|
long (ms) |
How frequently to poll for availability when a datasource is marked unavailable (default: 2000ms) |
|
int |
The number of threads in the worker thread pool used to invoke JDBC operations (default: 30) |
|
int |
The maximum number of work items in a queue before they are rejected (default: 600) |
|
long (ms) |
Timeout for retrieving a connection from the pool (default: 5000ms) |
|
long (ms) |
The maximum time a physical connection may be used before it will be closed instead of being returned to the pool (default: 60000ms) |
|
int |
The maximum sum of connections currently in use and available in pool (default: 30) |
|
int |
The maximum number of available connections kept in pool (default: 30) |
|
int |
The minimum number of available connections that a pool maintains |
|
long (ms) |
Maximum idle time for a connection before it is closed and removed from the pool (default: 30000ms) |
|
long (ms) |
How frequently to check for idle connections (default: 500ms) |
|
long (ms) |
How frequently to scan the connection pool for idle connections (default: 35000ms) |
|
long (ms) |
How long overload alarms will stay active before being cleared (default: 30000ms) |
The Url /URL attribute exists with both title case and upper case because some datasources use one form and some use the other.
|
Datasource properties profile attribute
The elements of the array for the DataSourceProperties
profile attribute have the following format:
Name
/Type
/Value
where
-
Name
is the DataSource property name -
Type
is the property type (a Java primitive or a Java class which has a constructor that takes a singlejava.lang.String
argument) -
Value
is the String representation of the value.
For example, to set the loginTimeout
property on an Oracle datasource to 10, the array element would be:
loginTimeout/java.lang.Integer/10
Type can be java.util.Properties
, in which case the Value must be a java.lang.String
that can be parsed by the
java.util.Properties.load(InputStream)
method ("name: value" separated by line breaks). Line breaks in Ant build files
can be specified by using the XML entity 

.
Oracle connection properties
The Oracle datasource has another means of setting connection properties: the setConnectionProperties(java.util.Properties)
method. These can be specified by the ConnectionProperties
attribute.
The value of this property must be a java.lang.String
that can be parsed by the java.util.Properties.load(InputStream)
method ("name: value" separated by line breaks). Line breaks in Ant build files can be specified by using the XML entity 

.
Per-node configuration
Per-node configuration (when nodes in a cluster require different configurations) is supported by having separate
DbQueryConfigProfile
profiles for each node. The resource adaptor must be configured with the configuration property
ConfigProfileAddNodeSuffix
set to true and a profile created for each node, named as follows:
-
ConfigProfile
__NodeID
For example, if the resource adaptor configuration specified ConfigProfile=MySQLConfig
and
ConfigProfileAddNodeSuffix=true
on a two-node cluster with nodes 101 and 102, then two profiles would be needed:
-
MySQLConfig__101
-
MySQLConfig__102
If a new node is added to the cluster and the resource adaptor is using per-node configuration, an appropriately named profile must be created before activating the resource adaptor entity on the new node.