Here are some tips to improve the performance of database access.
When dealing with large amounts of data, such as searching a large database, use JDBC directly rather than using Entity EJB components.
Combine business logic with the Entity EJB component that holds the data needed for that logic to process.
To ensure that connections are returned to the pool, always close the connections after use.
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 .