How to call SQL Server stored procedures and functions with JPA and Hibernate


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 SQL Server stored procedures and functions with JPA and Hibernate”

Impressions from Devoxx France 2016

Devoxx France 2016

I’ve just got back from Devoxx France, and I’m happy I got the chance to participate in such an event. The conference was really big (around 2500 participants) with many speakers from all around the world.

It’s all about the people

The best thing about going to a conference is the chance of meeting in person so many people that I only knew them from reading their blogs, using their frameworks, or from Twitter. I met Emmanuel Bernard, whose talks managed to fill in a whole amphitheater:

I got the chance to meet the organizers: Nicolas Martignole, Antonio Goncalves, Arnaud Héritier, and watch a live episode of Les Cast Codeurs.

By far the most entertaining presentation was Ten SQL tricks that you didn’t think they were possible by Lukas Eder, which was both interesting and funny.

I met Ludovic Orban who is the creator of the Bitronix Transaction Manager, a tool that I’ve been using extensively for a long time now.

Since I’ve been fascinated by the StackOverflow architecture, I couldn’t miss Oded Coster‘s presentation and managed to steal some high-performance tuning tips from him as well.

All in all, this was a great event.

The slides

My High-Performance Hibernate talk is very much inspired by the second part of my book. Enjoy watching it!

Subscribe to our Newsletter

* indicates required
10 000 readers have found this blog worth following!

If you subscribe to my newsletter, you'll get:
  • A free sample of my Video Course about running Integration tests at warp-speed using Docker and tmpfs
  • 3 chapters from my book, High-Performance Java Persistence, 
  • a 10% discount coupon for my book. 
Get the most out of your persistence layer!

How to run database integration tests 20 times faster


In-memory databases such as H2, HSQLDB, and Derby are great to speed up integration tests. Although most database queries can be run against these in-memory databases, many enterprise systems make use of complex native queries which can only be tested against an actual production-like relational database.

In this post, I’m going to show you how you can run PostgreSQL and MySQL integration tests almost as fast as any in-memory database.

Continue reading “How to run database integration tests 20 times faster”

High-Performance Java Persistence – Chapter 15 – Fetching

Part 2, Chapter 15

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 fetching works in Hibernate.

15. Fetching              
15.1 DTO projection          
15.1.1 DTO projection pagination         
15.1.2 Native query DTO projection       
15.2 Query fetch size           
15.3 Fetching entities          
15.3.1 Direct fetching  Fetching a Proxy reference Natural identifier fetching        
15.3.2 Query fetching           
15.3.3 Fetching associations  FetchType.EAGER   FetchType.LAZY The N+1 query problem How to catch N+1 query problems during testing LazyInitializationException The Open Session in View Anti-Pattern Temporary Session Lazy Loading Anti-Pattern Associations and pagination        
15.4 Query plan cache           

Continue reading “High-Performance Java Persistence – Chapter 15 – Fetching”