Chapter 20. Scaling Hibernate

 

In this chapter

  • Performing bulk and batch data operations
  • Improving scalability with the shared cache

You use object/relational mapping to move data into the application tier in order to use an object-oriented programming language to process that data. This is a good strategy when implementing a multiuser online transaction-processing application with small to medium size data sets involved in each unit of work.

On the other hand, operations that require massive amounts of data aren’t best-suited for the application tier. You should move the operation closer to where the data lives, rather than the other way around. In an SQL system, the DML statements UPDATE and DELETE execute directly in the database and are often sufficient if you have to implement an operation that involves thousands of rows. Operations that are more complex may require additional procedures to run inside the database; therefore, you should consider stored procedures as one possible strategy. You can fall back to JDBC and SQL at any time in Hibernate applications. We discussed some these options earlier, in chapter 17. In this chapter, we show you how to avoid falling back to JDBC and how to execute bulk and batch operations with Hibernate and JPA.

20.1. Bulk and batch processing

 
 

20.1.1. Bulk statements in JPQL and criteria

 
 
 

20.1.2. Bulk statements in SQL

 
 

20.1.3. Processing in batches

 
 
 
 

20.1.4. The Hibernate StatelessSession interface

 
 
 

20.2. Caching data

 
 
 

20.2.1. The Hibernate shared cache architecture

 
 

20.2.2. Configuring the shared cache

 
 
 

20.2.3. Enabling entity and collection caching

 
 
 

20.2.4. Testing the shared cache

 
 
 
 

20.2.5. Setting cache modes

 
 

20.2.6. Controlling the shared cache

 
 

20.2.7. The query result cache

 
 
 
 

20.3. Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage