Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Performance Tuning Guide

- Previous: Tuning Tips for Specific Types of EJB Components
- Next: Tuning Message-Driven Beans

## JDBC and Database Access

Here are some tips to improve the performance of database access.

### Use JDBC Directly

When dealing with large amounts of data, such as searching a large database, use JDBC directly rather than using Entity EJB components.

### Encapsulate Business Logic in Entity EJB Components

Combine business logic with the Entity EJB component that holds the data needed for that logic to process.

### Close Connections

To ensure that connections are returned to the pool, always close the connections after use.

### Minimize the Database Transaction Isolation Level

Use the default isolation level provided by the JDBC driver rather than calling `setTransactionIsolationLevel()`, unless you are certain that your application behaves correctly and performs better at a different isolation level.

Reduce the database transaction isolation level when appropriate. Reduced isolation levels reduce work in the database tier, and could lead to better application performance. However, this must be done after carefully analyzing the database table usage patterns.

Set the database transaction isolation level with the Admin Console on the Resources > JDBC > Connection Pools > PoolName page. For more information on tuning JDBC connection pools, see JDBC Connection Pool Settings .

- Previous: Tuning Tips for Specific Types of EJB Components
- Next: Tuning Message-Driven Beans

- © 2010, Oracle Corporation and/or its affiliates