How to get the actual execution plan for an Oracle SQL query using Hibernate query hints

Introduction

While answering this question on the Hibernate forum, I realized that it’s a good idea to write an article about getting the actual execution plan for an Oracle SQL query using Hibernate query hints feature.

Continue reading “How to get the actual execution plan for an Oracle SQL query using Hibernate query hints”

The fastest way to update a table row when using Hibernate and Oracle

Introduction

Oracle provides several pseudocolumns, and ROWID is one of them. The ROWID pseudocolumn specifies the address of the underlying database record, and according to Oracle documentation, it’s the fastest way to reference a table row.

As explained on Ask TOM, there are some operations that might lead to a ROWID change (e.g. partitioning or compacting tables). If that’s the case, then you should not rely on the ROWID pseudocolumn since its value iss no longer consistent.

If your database never executes an operation that triggers a ROWID modification, then you should consider using this technique.

In this article, I’m going to show you how you can access a database record by its ROWID when using Hibernate.

Continue reading “The fastest way to update a table row when using Hibernate and Oracle”

How does a relational database work

Introduction

While doing my High-Performance Java Persistence training, I came to realize that it’s worth explaining how a relational database works, as otherwise, it is very difficult to grasp many transaction-related concepts like atomicity, durability, and checkpoints.

In this post, I’m going to give a high-level explanation of how a relational database works internally while also hinting some database-specific implementation details.

Continue reading “How does a relational database work”

How to call Oracle stored procedures and functions with JPA and Hibernate

Introduction

This article is part of a series of posts related to calling various relational database systems stored procedures and database functions from Hibernate. The reason for writing this down is because there are many peculiarities related to the underlying JDBC driver support and not every JPA or Hibernate feature is supported on every relational database.

Continue reading “How to call Oracle stored procedures and functions with JPA and Hibernate”