Server User Manual
Table Of Contents
- Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide
- Preface
- Overview of Enterprise Server Performance Tuning
- Tuning Your Application
- Java Programming Guidelines
- Java Server Page and Servlet Tuning
- EJB Performance Tuning
- Goals
- Monitoring EJB Components
- General Guidelines
- Using Local and Remote Interfaces
- Improving Performance of EJB Transactions
- Use Container-Managed Transactions
- Don’t Encompass User Input Time
- Identify Non-Transactional Methods
- Use TX_REQUIRED for Long Transaction Chains
- Use Lowest Cost Database Locking
- Use XA-Capable Data Sources Only When Needed
- Configure JDBC Resources as One-Phase Commit Resources
- Use the Least Expensive Transaction Attribute
- Using Special Techniques
- Tuning Tips for Specific Types of EJB Components
- JDBC and Database Access
- Tuning Message-Driven Beans
- Tuning the Enterprise Server
- Deployment Settings
- Logger Settings
- Web Container Settings
- EJB Container Settings
- Java Message Service Settings
- Transaction Service Settings
- HTTP Service Settings
- ORB Settings
- Thread Pool Settings
- Resources
- Tuning the Java Runtime System
- Tuning the Operating System and Platform
- Tuning for High-Availability
- Index

Connection
Validation
Required
If true, the pool validates connections (checks to nd out if they are usable) before providing them to an
application.
If possible, keep the default value, false. Requiring connection validation forces the server to apply the
validation algorithm every time the pool returns a connection, which adds overhead to the latency of
getConnection(). If the database connectivity is reliable, you can omit validation.
Validation Method Type of connection validation to perform. Must be one of:
■
auto-commit: attempt to perform an auto-commit on the connection.
■
metadata: attempt to get metadata from the connection.
■
table (performing a query on a specied table). Must also set Table Name. You may have to use this method
if the JDBC driver caches calls to setAutoCommit() and getMetaData().
Table Name Table name to query when Validation Method is “table.”
Close All
Connections On
Any Failure
Whether to close all connections in the pool if a single validation check fails. The default is false. One
attempt will be made to re-establish failed connections.
Connector Connection Pool Settings
From a performance standpoint, connector connection pools are similar to JDBC connection
pools. Follow all the recommendations in the previous section,
“Tuning JDBC Connection
Pools” on page 77
Transaction Support
You may be able to improve performance by overriding the default transaction support
specied for each connector connection pool.
For example, consider a case where an Enterprise Information System (EIS) has a connection
factory that supports local transactions with better performance than global transactions. If a
resource from this EIS needs to be mixed with a resource coming from another resource
manager, the default behavior forces the use of XA transactions, leading to lower performance.
However, by changing the EIS’s connector connection pool to use LocalTransaction transaction
support and leveraging the Last Agent Optimization feature previously described, you could
leverage the better-performing EIS LocalTransaction implementation. For more information
on LAO, see
“Congure JDBC Resources as One-Phase Commit Resources” on page 39
In the Admin Console, specify transaction support when you create a new connector
connection pool, and when you edit a connector connection pool at Resources > Connectors >
Connector Connection Pools.
Also set transaction support using asadmin. For example, the following asadmin command
could be used to create a connector connection pool “TESTPOOL” with the
transaction-support as “LOCAL”.
Connection Validation Required
Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 200980










