web server - Borland Technical Publications

web server - Borland Technical Publications web server - Borland Technical Publications

techpubs.borland.com
from techpubs.borland.com More from this publisher
12.11.2014 Views

Defining the Connection Pool Properties for a JDBC Datasource 6 Stop and restart the partition for the deployment to take effect. To deploy the library to a single partition: 1 Right-click on the partition's name in the navigation pane in the BES Console and select Deploy Modules from the context menu. The Deployment Wizard will open. 2 Click on the Add button and navigate to the library file in the resulting window and click OK. The library name should now appear in the selection box in the Deployment Wizard. 3 Click on the Next button. The partition name will appear in the Deployment Wizard window. 4 Select the partition to which you want to deploy the library and click on the Finish button. The deployment status will appear in a separate window. 5 Click the Close button to close this window. You can verify that the libraries are deployed correctly by checking the partition's Deployed Modules node in the BES Console navigation pane. The name of the library should appear under the Deployed Modules node. 6 Stop and restart the partition for the deployment to take effect. Defining the Connection Pool Properties for a JDBC Datasource At runtime each JDBC datasource corresponds to an instance of a connection pool. Connection pools provide for the reuse of connections and optimization of database connectivity. Some datasources may require different treatment as connection pools than others. A number of configuration options exist for these connection pools. Control of pool sizes, statement execution behavior, and transaction parameters are specified as properties in the element in the DAR descriptor file. You specify properties using the element, which includes the , , and elements. The complete list of properties, allowed values, defaults, and descriptions appear in the following table: Table 22.1 Connection Pool Properties for a JDBC Datasource Name Allowed Values Description Default Value connectionType Enumerated: ■ ■ Direct XA Indicates type transaction association of all connections retrieved from the connection pool, whether “Direct” or “XA” optimizeXA Boolean By default, XAResource calls are limited to optimize JDBC 2 connection pool performance. Setting optimizeXA to false disables this optimization. Under certain conditions the optimization must be disabled. For instance, when conflicts arise with resource manager optimizations during twophase commit protocol. When setting optimizeXA to false applications using a JDBC connection in the scope of a distributed transaction, must issue a connection close() before completion of the transaction, otherwise unexpected transaction completion conditions will arise. Not Applicable. Property specification is mandatory True Chapter 22: Using JDBC 199

Defining the Connection Pool Properties for a JDBC Datasource Table 22.1 maxPoolSize Integer Specifies the maximum number of database connections that can be obtained from this datasource connection pool. waitTimeout Integer The number of seconds to wait for a free connection when maxPoolSize connections are already opened. When using the maxPoolSize property and the pool is at its max and can't serve any more connections, the threads looking for JDBC connections end up waiting for the connection(s) to become available for a long time if the wait time is unbounded (set to 0 seconds). You can set the waitTimeout period to suit your needs. busyTimeout Integer The number of seconds to wait before a busy connection is released idleTimeout Integer A pooled connection remaining in an idle state for a period of time longer than this timeout value should be closed. All idle connections are checked for idleTimeout expiration every 60 seconds. The value of the idleTimeout is given in seconds. queryTimeout Integer Specifies in seconds the time limit for executing database queries by this datasource. dialect isolationLevel Connection Pool Properties for a JDBC Datasource (continued) Name Allowed Values Description Default Value Enumerated: ■ ■ ■ ■ oracle sybase interbase jdatastore Enumerated: ■ ■ ■ ■ ■ TRANSACTION_NONE TRANSACTION_READ_C OMMITTED TRANSACTION_READ_U NCOMMITTED TRANSACTION_REPREA TABLE_READ TRANSACTION_SERIAL IZEABLE Specifies the database vendor as a hint for automatic table creation performed during Container Managed Persistence Indicates database isolation level associated with all connections opened by this datasource's connection pool. See the J2EE 1.3 specification for details on these isolation levels. reuseStatements Boolean Optimization directive requesting prepared SQL statements to be cached for reuse. Applies to all connections obtained from the connection pool. initSQL String Specifies a list of “;” separated SQL statements to be executed each time a connection is obtained for a fresh transaction. The SQL is performed before any application work is performed on the connection. 0 (zero), implying unbounded size 30 600 (ten minutes) 600 (ten minutes) 0 (zero), implying indefinite period This property is optional. There is no default value. Defaults to whatever level is provided by the JDBC driver vendor. True This property is optional. There is no default value. 200 BES Developer’s Guide

Defining the Connection Pool Properties for a JDBC Datasource<br />

Table 22.1<br />

maxPoolSize Integer Specifies the maximum number of<br />

database connections that can be<br />

obtained from this datasource<br />

connection pool.<br />

waitTimeout Integer The number of seconds to wait for<br />

a free connection when<br />

maxPoolSize connections are<br />

already opened. When using the<br />

maxPoolSize property and the pool<br />

is at its max and can't serve any<br />

more connections, the threads<br />

looking for JDBC connections end<br />

up waiting for the connection(s) to<br />

become available for a long time if<br />

the wait time is unbounded (set to<br />

0 seconds). You can set the<br />

waitTimeout period to suit your<br />

needs.<br />

busyTimeout Integer The number of seconds to wait<br />

before a busy connection is<br />

released<br />

idleTimeout Integer A pooled connection remaining in<br />

an idle state for a period of time<br />

longer than this timeout value<br />

should be closed. All idle<br />

connections are checked for<br />

idleTimeout expiration every 60<br />

seconds. The value of the<br />

idleTimeout is given in seconds.<br />

queryTimeout Integer Specifies in seconds the time limit<br />

for executing database queries by<br />

this datasource.<br />

dialect<br />

isolationLevel<br />

Connection Pool Properties for a JDBC Datasource (continued)<br />

Name Allowed Values Description Default Value<br />

Enumerated:<br />

■<br />

■<br />

■<br />

■<br />

oracle<br />

sybase<br />

interbase<br />

jdatastore<br />

Enumerated:<br />

■<br />

■<br />

■<br />

■<br />

■<br />

TRANSACTION_NONE<br />

TRANSACTION_READ_C<br />

OMMITTED<br />

TRANSACTION_READ_U<br />

NCOMMITTED<br />

TRANSACTION_REPREA<br />

TABLE_READ<br />

TRANSACTION_SERIAL<br />

IZEABLE<br />

Specifies the database vendor as<br />

a hint for automatic table creation<br />

performed during Container<br />

Managed Persistence<br />

Indicates database isolation level<br />

associated with all connections<br />

opened by this datasource's<br />

connection pool. See the J2EE 1.3<br />

specification for details on these<br />

isolation levels.<br />

reuseStatements Boolean Optimization directive requesting<br />

prepared SQL statements to be<br />

cached for reuse. Applies to all<br />

connections obtained from the<br />

connection pool.<br />

initSQL String Specifies a list of “;” separated<br />

SQL statements to be executed<br />

each time a connection is<br />

obtained for a fresh transaction.<br />

The SQL is performed before any<br />

application work is performed on<br />

the connection.<br />

0 (zero),<br />

implying<br />

unbounded<br />

size<br />

30<br />

600 (ten<br />

minutes)<br />

600 (ten<br />

minutes)<br />

0 (zero),<br />

implying<br />

indefinite<br />

period<br />

This property<br />

is optional.<br />

There is no<br />

default value.<br />

Defaults to<br />

whatever<br />

level is<br />

provided by<br />

the JDBC<br />

driver vendor.<br />

True<br />

This property<br />

is optional.<br />

There is no<br />

default value.<br />

200 BES Developer’s Guide

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!