Skip to main content

Batch Processing and Native SQL

  • Chapter
  • First Online:
Hibernate Recipes

Abstract

is the processing of groups of elements. From an application standpoint, batch processing means reading data from a persistent store, doing something with the data, and then possibly storing the processed data in the persistent store as a single conceptual operation. Batch processing, which allows for the automation and sharing of computer resources, is usually run when computer resources are less busy.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 29.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 39.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    To be sure, this is not the only way to accomplish the application of discounts based on specific circumstances; a rules engine would work as well, and would probably be more appropriate than altering your actual data.

  2. 2.

    This number is pulled out of a hat. It’s a good number and an excellent starting point, but if you really want to know what the best number of operations in a single transaction would be, you have to roll up your sleeves and test. Unfortunately, “best number of operations” is difficult to define in a general sense (outside of “does it work?”), so there’s no good way to demonstrate such a test.

  3. 3.

    Hey, there’s that Hat of Generally Useful Numbers again!

  4. 4.

    You can commit a transaction and start a new one to do a “batch operation” as well, but that would invalidate our (somewhat artificial) requirement to maintain a single transaction. In general, we’ve been closing the Session when committing transactions, mostly to explicitly clear the Session's first-level cache.

  5. 5.

    What we’d prefer is that books with Hibernate in their titles get a $10 premium. But “discount” it is!

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Joseph Ottinger

About this chapter

Cite this chapter

Ottinger, J., Guruzu, S., Mak, G. (2015). Batch Processing and Native SQL. In: Hibernate Recipes. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0127-5_11

Download citation

Publish with us

Policies and ethics