Optionally,the application server can validate connections before they are passed to
applications.This validation allows the application server to automatically reestablish
databaseconnections if the database becomes unavailable due to network failure or database
servercrash. Validation of connections incurs additional overhead and slightly reduces
performance.
Parameter Description
ConnectionValidation Selectthe Required checkbox to enable connection validation.
ValidationMethod Theapplication server can validate database connections in three ways:
auto-commit,metadata, and table.
auto-commitand metadata - The application server validates a connection
bycalling the con.getAutoCommit() and con.getMetaData() methods.
Auto-commitvalidation makes use of two methods for validating the
connection.getAutoCommit()is used to retrieve the current state of
auto-commitand setAutoCommit() to change the state of auto-commit.
Thisallows actual contact with the database to take place.
getAutomCommit()mightor might not contact the database, depending on
theimplementation. Actual physical connection will be wrapped for
dierentpurposes, such as a connection pool.
Note– Because many JDBC drivers cache the results of these calls, they do
notalways provide reliable validations. Check with the driver vendor to
determinewhether these calls are cached or not.
table- The application queries a database table that are specied. The table
mustexist and be accessible, but it doesn't require any rows. Do not use an
existingtable that has a large number of rows or a table that is already
frequentlyaccessed.
TableName Ifyou selected table from the Validation Method combo box, then specify
thename of the database table here.
OnAny Failure Ifyou select the checkbox labelled Close All Connections, if a single
connectionfails, then the application server closes all connections in the
pooland then reestablish them. If you do not select the checkbox, then
individualconnections are reestablished only when they are used.
AllowNon Component Callers Clickthis check box if you want to enable the pool for use by
non-componentcallers such as Servlet Filters and Lifecycle modules.
4. Changetransaction isolation settings.
Becausea database is usually accessed by many users concurrently, one transaction might
updatedata while another attempts to read the same data. The isolation level of a
transactiondenes the degree to which the data being updated is visible to other
transactions.For details on isolation levels, refer to the documentation of the database
vendor.
WorkingwithJDBC Connection Pools
Chapter3 •JDBC Resources 49