Sun Microsystems GlassFish Enterprise Server 2.1 Administration Manual page 49

Hide thumbs Also See for GlassFish Enterprise Server 2.1:
Table of Contents

Advertisement

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
Connection Validation
Validation Method
Table Name
On Any Failure
Allow Non Component Callers
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 defines 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.
Chapter 3 • JDBC Resources
Description
Select the Required checkbox to enable connection validation.
The application server can validate database connections in three ways:
auto-commit, metadata, and table.
auto-commit and metadata - The application server validates a connection
by calling the con.getAutoCommit() and con.getMetaData() methods.
Auto-commit validation makes use of two methods for validating the
connection.getAutoCommit() is used to retrieve the current state of
auto-commit and setAutoCommit() to change the state of auto-commit.
This allows actual contact with the database to take place.
getAutomCommit()might or might not contact the database, depending on
the implementation. Actual physical connection will be wrapped for
different purposes, such as a connection pool.
Because many JDBC drivers cache the results of these calls, they do
Note –
not always provide reliable validations. Check with the driver vendor to
determine whether these calls are cached or not.
table - The application queries a database table that are specified. The table
must exist and be accessible, but it doesn't require any rows. Do not use an
existing table that has a large number of rows or a table that is already
frequently accessed.
If you selected table from the Validation Method combo box, then specify
the name of the database table here.
If you select the checkbox labelled Close All Connections, if a single
connection fails, then the application server closes all connections in the
pool and then reestablish them. If you do not select the checkbox, then
individual connections are reestablished only when they are used.
Click this check box if you want to enable the pool for use by
non-component callers such as Servlet Filters and Lifecycle modules.
Working with JDBC Connection Pools
49

Advertisement

Table of Contents
loading

Table of Contents