Sun Microsystems 820433510 Server User Manual


 
Optionally, the application server can validate connections before they are passed to
applications. This validation allows the application server to automatically reestablish
database connections if the database becomes unavailable due to network failure or database
server crash. Validation of connections incurs additional overhead and slightly reduces
performance.
Parameter Description
Connection Validation Select the Requiredcheckbox to enable connection validation.
Validation Method The application servercan validate database connections in threeways:
auto-commit, metadata, andtable.
auto-commit and metadata- The application server validates aconnection
by calling thecon.getAutoCommit() and con.getMetaData() methods.
Auto-commit validation makesuse of two methods forvalidating the
connection.getAutoCommit() is used to retrieve the current state of
auto-commit and setAutoCommit() to change the state of auto-commit.
This allows actualcontact with the database to takeplace.
getAutomCommit()might or might notcontact the database, depending on
the implementation. Actual physicalconnection will be wrapped for
dierent purposes, suchas a connection pool.
Note Because manyJDBC drivers cache theresults of thesecalls, they do
not always providereliable validations. Check with the drivervendor to
determine whether thesecalls are cached or not.
table - Theapplication queries a database table thatare specied. The table
must exist andbe accessible, but it doesn't requireany rows. Do not use an
existing table thathas a large number of rowsor a table that is already
frequently accessed.
Table Name If you selected tablefrom the Validation Method combo box,then specify
the name ofthe database table here.
On Any Failure If youselect the checkbox labelled Close AllConnections, ifa single
connection fails, thenthe application server closes all connectionsin the
pool and thenreestablish them. If you donot select the checkbox, then
individual connections arereestablished only when they are used.
Allow Non Component Callers Click thischeck box if you want toenable the pool for use by
non-component callers suchas Servlet Filters and Lifecyclemodules.
4. Change transaction isolation settings.
Because a database is usually accessed by many users concurrently, one transaction might
update data while another attempts to read the same data. The isolation level of a
transaction de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.
Workingwith JDBCConnectionPools
Chapter3 • JDBCResources 49