3.11.28 /resources/jdbc-connection-pool
/resources/jdbc-connection-pool defines properties that are required for creating a JDBC connection pool.
Description
/resources/jdbc-connection-pool defines attributes and properties that are required for creating a JDBC connection pool.
Repetition pattern
0 or more times.
Specifiable attributes
Attribute name |
Description |
Specifiable values |
Default value# |
Dependencies |
Repetition pattern |
---|---|---|---|---|---|
name |
Specifies the name of the connection pool. This name refers to the pool-name attribute of a jdbc-resource element |
Type: String |
No default value |
N/A |
Only one time |
datasource-classname |
Specifies the class name of the associated vendor-supplied data source. This class must implement javax.sql.DataSource, javax.sql.XADataSource, javax.sql.ConnectionPoolDatasource, or a combination. |
Type: String |
No default value |
N/A |
0 or 1 time |
res-type |
Specifies the interface that the data source class implements. To support the configuration of JDBC drivers and applications that use java.sql.Driver implementations, set this attribute to java.sql.Driver. This attribute must be specified to avoid ambiguity when a data source class implements two or more of these interfaces or when a driver-classname is specified. An error occurs if this attribute has a legal value and the indicated interface is not implemented by the data source class. |
Type: String {javax.sql.DataSource | javax.sql.XADataSource | javax.sql.ConnectionPoolDatasource | java.sql.Driver} |
No default value |
N/A |
0 or 1 time |
driver-classname |
Specifies the vendor-supplied JDBC driver class name. This driver must implement the java.sql.Driver interface. |
Type: String Any class (sub-class) name which implements the interface java.sql.Driver |
No default value |
N/A |
0 or 1 time |
ping |
Specifies whether to ping the pool during pool creation or reconfiguration to identify and warn of any incorrect attribute values. |
Type: Boolean {true | false} |
false |
N/A |
0 or 1 time |
steady-pool-size |
Specifies the initial and minimum number of connections maintained in the pool. |
Type: Integer 0 to 2147483647 |
24 |
N/A |
0 or 1 time |
max-pool-size |
Specifies the maximum number of connections that can be created to satisfy client requests. |
Type: Integer 1 to 2147483647 |
24 |
N/A |
0 or 1 time |
max-wait-time-in-millis |
Specifies the amount of time, in milliseconds, that a caller is willing to wait for a connection. If 0 milliseconds, then the caller is blocked indefinitely until a resource is available or an error occurs. |
Type: Integer 0 to 2147483647 |
60000 |
N/A |
0 or 1 time |
pool-resize-quantity |
Specifies the number of idle connections to be destroyed if the existing number of connections is above the steady-pool-size (subject to the max-pool-size limit). This is enforced periodically at the idle-timeout-in-seconds interval. An idle connection is one that has not been used for a period of idle-timeout-in-seconds. When the pool size reaches steady-pool-size, connection removal stops. |
Type: Integer 1 to 2147483647 |
2 |
N/A |
0 or 1 time |
idle-timeout-in-seconds |
Specifies the maximum time that a connection can remain idle in the pool. After this amount of time, the pool can close this connection. This timeout value must be kept smaller than the server side (database) timeout value to prevent the accumulation of unusable connections in the application. |
Type: Integer 0 to 2147483647 |
300 |
N/A |
0 or 1 time |
transaction-isolation-level |
Specifies the transaction isolation level on the pooled database connections. Transaction Isolation Level: read-uncommitted Description: Dirty reads, non-repeatable reads, and phantom reads can occur. Transaction Isolation Level: read-committed Description: Dirty reads are prevented; non-repeatable reads and phantom reads can occur. Transaction Isolation Level: repeatable-read Description: Dirty reads and non-repeatable reads are prevented; phantom reads can occur. Transaction Isolation Level: serializable Description: Dirty reads, non-repeatable reads and phantom reads are prevented. |
Type: String {read-uncommitted | read-committed | repeatable-read | serializable} |
Default JDBC driver isolation level |
N/A |
0 or 1 time |
is-isolation-level-guaranteed |
Applicable only when transaction-isolation-level is explicitly set. If true, then every connection obtained from the pool is guaranteed to have the desired isolation level. This might impact performance on some JDBC drivers. Set this attribute to false only if you are certain that the hosted applications do not return connections with altered isolation levels. |
Type: Boolean {true | false} |
true |
N/A |
0 or 1 time |
is-connection-validation-required |
Specifies whether connections have to be validated before being given to the application. If a resource's validation fails, it is destroyed, and then a new resource is created and returned. |
Type: Boolean {true | false} |
false |
N/A |
0 or 1 time |
connection-validation-method |
Legal values are as follows:
As many JDBC drivers cache the results of auto-commit and meta-data calls, they do not always provide reliable validations. Verify with the driver vendor to determine whether these calls are cached or not. The table must exist and be accessible, but it does not require any rows. Do not use an existing table that has a large number of rows or a table that is already frequently accessed. |
Type: String {auto-commit | meta-data | table | custom-validation} |
table |
N/A |
0 or 1 time |
validation-table-name |
Specifies the table name to be used to perform a query to validate a connection. This parameter is mandatory only if the connection-validation-method is set to table. |
Type: String |
No default value |
N/A |
0 or 1 time |
validation-classname |
Specifies the custom validation implementation class name. This parameter is mandatory if connection-validation-method is set to custom-validation. The class name provided must be accessible to the Java EE Server. |
Type: String Any class (sub-class) name which implements the interface org.glassfish.api.jdbc.ConnectionValidation |
No default value |
N/A |
0 or 1 time |
non-transactional-connections |
If true, then non-transactional connections can be made to the JDBC connection pool. These connections are not automatically enlisted with the transaction manager. |
Type: Boolean {true | false} |
false |
N/A |
0 or 1 time |
validate-atmost-once-period-in-seconds |
Specifies the time interval within which a connection is validated at most once. Minimizes the number of validation calls. A value of zero implies that Java EE Server does not attempt to minimize the number of validation requests by a connection. That is, a value of zero disables this attribute. |
Type: Integer 0 to 2147483647 |
0 |
N/A |
0 or 1 time |
connection-leak-timeout-in-seconds |
Detects potential connection leaks by the application. A connection that is not returned back to the pool by the application within the specified period is assumed to be potentially leaking, and a stack trace of the caller is logged. A zero value disables leak detection. A non zero value enables leak tracing. Use this attribute along with connection-leak-reclaim to avoid potential connection leaks from the application. |
Type: Integer 0 to 2147483647 |
0 |
N/A |
0 or 1 time |
connection-leak-reclaim |
If true, then the pool reclaims a connection after connection-leak-timeout-in-seconds occurs. |
Type: Boolean {true | false} |
false |
N/A |
0 or 1 time |
connection-creation-retry-attempts |
Specifies the number of attempts to create a new connection in case of a failure. |
Type: Integer 0 to 2147483647 |
0 |
N/A |
0 or 1 time |
connection-creation-retry-interval-in-seconds |
Specifies the time interval between attempts to create a connection when connection-creation-retry-attempts is greater than 0. |
Type: Integer 0 to 2147483647 |
10 |
N/A |
0 or 1 time |
statement-timeout-in-seconds |
Sets the query timeout property of a statement to enable termination of abnormally long running queries.-1 disables this feature. An abnormally long running JDBC query executed by an application may leave it in a hanging state unless a timeout is explicitly set on the statement. This attribute guarantees that all queries automatically time out if not completed within the specified period. When statements are created, the queryTimeout is set according to the value specified in this attribute. This works only when the underlying JDBC driver supports queryTimeout for Statement, PreparedStatement, CallableStatement, and ResultSet. |
Type: Integer -1 to 2147483647 |
-1 |
N/A |
0 or 1 time |
lazy-connection-enlistment |
If true, then a connection is not enlisted in a transaction until it is used. If false, then any connection object available to a transaction is enlisted in the transaction. |
Type: Boolean {true | false} |
false |
N/A |
0 or 1 time |
lazy-connection-association |
If true, then a physical connection is not associated with a logical connection until it is used. If false, then a physical connection is associated with a logical connection even before it is used. |
Type: Boolean {true | false} |
false |
N/A |
0 or 1 time |
match-connections |
Specifies whether a connection that is selected from the pool should be matched with the connections with certain credentials. If true, then it enables connection matching. You can set to false if connections are homogeneous. If the connection pool is used by applications that have multiple user credentials, then match-connections must be true. The connection pool matches the request credential with the connections in the pool and returns a matched connection for use. For new requests with different credentials, unmatched free connections are automatically purged to provide new connections to satisfy the new requests. This attribute need not be true if it is known that there is only one credential used by the applications and therefore the pool has homogeneous connections. |
Type: Boolean {true | false} |
false |
N/A |
0 or 1 time |
max-connection-usage-count |
Specifies the number of times a connections is reused by the pool, after which it is closed. A zero value disables this feature. By limiting the maximum number of times a connection can be reused, you can avoid statement leaks if the application does not close statements. |
Type: Integer 0 to 2147483647 |
0 |
N/A |
0 or 1 time |
statement-cache-size |
Specifies the number of statements to be cached using the lru (Least Recently Used) caching mechanism. Value of 0 disables statement caching. |
Type: Integer 0 to 2147483647 |
0 |
N/A |
0 or 1 time |
pooling |
Specifies whether connection is pooled or not. |
Type: Boolean {true | false} |
true |
N/A |
0 or 1 time |
- Legend:
-
N/A: Not applicable
#: This is the default value that is set when a definition item is excluded.