High-Performance Java Persistence – Chapter 10 – Mapping Types and Identifiers

Part 2, Chapter 10 Every new chapter of my book is released right after it’s being completed, so the reader doesn’t have to wait for the whole part to be finished to get access to new material. Table of content This chapter explains the core mapping elements used by Hibernate and details the basic type and the identifier generators.

High-Performance Java Persistence – Chapter 9 – Hibernate Connection Management

Part 2, Chapter 9 Every new chapter of my book is released right after it’s being completed, so the reader doesn’t have to wait for the whole part to be finished to get access to new material. Table of content This chapter explains how to handle connections in Hibernate and how to monitor their usage as well as the statement that gets automatically generated, and the table of contents looks like this:

High-Performance Java Persistence – Chapter 8 – Why JPA and Hibernate matter

Second part, Chapter 8 Now that the first part of my book is published, it’s time to focus on the second part, which covers both JPA and Hibernate. From now on, every new chapter is going to be released right after it’s completed, so the reader doesn’t have to wait for the whole part to be finished to get access to new chapters. Table of content This chapter aims to remind the reader why Hibernate has its place in high-performance data access, and the table of contents looks like this:

High-Performance Java Persistence – Part One

The journey Four months, one week and two days and 114 pages; that’s how much it took to write the first part of the High-Performance Java Persistence book. As previously stated, the book is developed in an Agile fashion. Each part represents a milestone, which is accompanied by a release. This way, the readers can get access to the book content prior to finishing the whole book (which might take a year or so).

The High-Performance Java Persistence book

A book in the making It’s been a year since I started the quest for a highly-effective Data Knowledge Stack and the Hibernate Master Class contains over fifty articles already. Now that I covered many aspects of database transactions, JDBC and Java Persistence, it’s time to assemble all the pieces together into the High-Performance Java Persistence book.

How to monitor a Java EE DataSource

Introduction FlexyPool is an open-source framework that can monitor a DataSource connection usage. This tool come out of necessity, since we previously lacked support for provisioning connection pools. FlexyPool was initially designed for stand-alone environments and the DataSource proxy configuration was done programmatically. Using Spring bean aliases, we could even substitute an already configured DataSource with the FlexyPool Metrics-aware proxy alternative.

How to optimize unidirectional collections with JPA and Hibernate

Introduction Hibernate supports three data mapping types: basic (e.g String, int), Embeddable and Entity. Most often, a database row is mapped to an Entity, each database column being associated to a basic attribute. Embeddable types are more common when combining several field mappings into a reusable group (the Embeddable being merged into the owning Entity mapping structure). Both basic types and Embeddables can be associated to an Entity through the @ElementCollection, in a one-Entity-many-non-Entity relationship. Although we are going to explain these optimizations using an @ElementCollection, the same rules apply to any… Read More

ResultSet statement fetching with JDBC and Hibernate

Introduction Now that I covered Hibernate batch support for INSERT, UPDATE and DELETE statements, it’s time to analyze SELECT statements result set batch fetching. JDBC ResultSet fetching The JDBC ResultSet offers a client-side Proxy cursor for fetching the current statement return data. When the statement gets executed, the result must be transferred from the database cursor to the client-side one. This operation can either be done at once or on demand.

How to batch DELETE statements with Hibernate

Introduction In my previous post, I explained the Hibernate configurations required for batching INSERT and UPDATE statements. This post will continue this topic with DELETE statements batching. Domain model entities We’ll start with the following entity model:

How to batch INSERT and UPDATE statements with Hibernate

Introduction JDBC has long been offering support for DML statement batching. By default, all statements are sent one after the other, each one in a separate network round-trip. Batching allows us to send multiple statements in one-shot, saving unnecessary socket stream flushing. Hibernate hides the database statements behind a transactional write-behind abstraction layer. An intermediate layer allows us to hide the JDBC batching semantics from the persistence layer logic. This way, we can change the JDBC batching strategy without altering the data access code. Configuring Hibernate to support JDBC batching is not… Read More