Friday, June 1, 2012

Hibernate Caching Gotcha: Get Operations with Empty Results

When a "get" operation returns an empty result, the 2nd level cache is not populated with a cached copy of the entity. As such, the next time the same operation is performed, a query will be run on the database. If this happens a lot, it will introduce much additional load on the database.

As part of the performance optimization, clear-cut cases where empty results can happen should be eliminated.

No comments:

Post a Comment