
EJB Performance Tuning
Avoid
<ejb>
...
<cmp>
</cmp>
</ejb>
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.
46 | Sun GlassFish Enterprise Server 2.1 Performance Tuning Guide • January 2009 |