EJB Performance Tuning
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” on page 77 .
Tuning Message-Driven Beans
This section provides some tips to improve performance when using JMS with
Use getConnection()
JMS connections are served from a connection pool. This means that calling getConnection() on a Queue connection factory is fast.
Caution – Previous to version 8.1, it was possible to reuse a connection with a servlet or EJB component. That is, the servlet could call getConnection() in its init() method and then continually call getSession() for each servlet invocation. If you use JMS within a global transaction, that no longer works: applications can only call getSession() once for each connection. After than, the connection must be closed (which doesn’t actually close the connection; it merely returns it to the pool). This is a general feature of portable Java EE 1.4 applications; the Sun Java System Application Server enforces that restriction where previous (Java EE
Tune the Message-Driven Bean’s Pool Size
The container for
Tune the
You can configure MDB pool settings in the Admin Console at Configurations >
asadmin set server.mdb-container.max-pool-size = value
Chapter 2 • Tuning Your Application | 47 |