O'Reilly logo

Java EE 7 Performance Tuning and Optimization by Osama Oransa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Database performance tuning tips

Database performance is considered as the most critical factor in our application's performance, and most of a transaction's latency is caused by the database. In this section, we will provide some performance recommendations when dealing with the database from the development perspective.

Always stick to using a server-managed connection pooling when accessing the database and avoid using direct connections to the database.

The connection should be released immediately after finishing our database interaction. Also, it is recommended that you use prepared statements as it gets compiled and hence, is more efficient to use when executing the same query many times with different parameters.

If we are using the Object-relational ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required