hibernate

A collection of 17 posts

A Java geek
  • Me
  • Books
  • Speaking
  • Mentions
  • Focus
Mar 28, 2021 hibernate jpa persistence

A (definitive?) guide on LazyInitializationException

Posts that have been written about Hibernate’s LazyInitializationException could probably fill whole books. Yet, I believe each of them focuses on a particular aspect of it: some on a specific solution, some on how to solve it with Spring Boot, etc. I’d like this post to be the definitive guide on the subject, even though I’m pretty sure it won’t. At least, I’ll be able to point others to it.

Nicolas Fränkel
Jul 5, 2020 hibernate query cache performance

Digging into Hibernate's Query Cache

I haven’t used Hibernate for a long time, and I haven’t blogged about it for even longer. Recently, I was working on a blog post in the context of my job on setting up an evergreen cache. When I was coding the demo, I faced some issue regarding Hibernate’s Query Cache: it didn’t work as I expected it to. Finally, after some time, I managed to fix the issue.

Nicolas Fränkel
Sep 29, 2019 hibernate query jpa persistence

Hibernate's Query-By-Example

Despite the current trend regarding &nbps;ORM frameworks, I never had any issue using JPA nor Hibernate. I must admit that my use-cases were pretty simple. Also, since that was already some years ago, we hosted those applications on our own on-site infrastructure so that the search for the ultimate performance - and its associated savings - was not a goal; empowering junior developers who were not familiar with a lot of technologies was.

Nicolas Fränkel
Sep 22, 2013 hibernate jooq persistence

No more Hibernate? Really?

I recently stumbled upon this punchy one-liner: No More Hibernate!. At first, I couldn’t believe what I read. Then, scrolling down, I noticed that the site was linked to jOOQ, a framework that advocates for SQL to have a first-class status in Java: SQL was never meant to be abstracted. To be confined in the narrow boundaries of heavy mappers, hiding the beauty and simplicity of relational data. SQL was never meant to be object-oriented.

Nicolas Fränkel
Jun 24, 2012 envers hibernate persistence

How to test code that uses Envers

Envers is a Hibernate module that can be configured to automatically audit changes made to your entities. Each audited entity are thus associated with a list of revisions, each revision capturing the state of the entity when a change occurs. There is however an obstacle I came across while I was 'unit testing' my DAO, and that’s what I want to share to avoid others to fall in the same pit.

Nicolas Fränkel
Jun 5, 2011 hibernate

Hibernate hard facts – Part 7

This is the 7th post in the Hibernate hard facts focus series. In this post, we’ll have a look at the difference between saveOrUpdate() and merge(). Hibernate’s way for updating entities is through the update() method. We can get an object, detach it from the session and then update it later with no problem.

Nicolas Fränkel
Nov 1, 2010 architecture hibernate

The OpenSessionInView antipattern

With such a controversial title, I’m bound to be the target of heated comments. Although provocative, such is not my goal, however, I just want to initiate an educated debate between people that are interested into thinking about the problem. The origin of this post was a simple discussion between developers of different level of experience on Hibernate. The talk was about eager-, lazy-loading and the infamous LazyInitializationException.

Nicolas Fränkel
Oct 4, 2010 hibernate

Hibernate hard facts - Part 6

This is the 6th post in the Hibernate hard facts focus series. In this article, I will show you how to use the fetch profile feature introduced in Hibernate 3.5. Lazy loading is a core feature in Hibernate: it saves memory space. The reasoning behind it is, if you don’t use an association, you don’t need the object and thus, Hibernate does not load it into memory. Hibernate fills the lazy loaded attribute with a proxy that makes the SQL request when the getter is called.

Nicolas Fränkel
Apr 13, 2010 hibernate p6spy sql

Debugging Hibernate generated SQL

In this article, I will explain how to debug Hibernate’s generated SQL so that unexpected query results be traced faster either to a faulty dataset or a bug in the query.

Nicolas Fränkel
Mar 1, 2010 hibernate persistence spring

Spring Persistence with Hibernate

This review is about Spring Persistence with Hibernate by Ahmad Reza Seddighi from Packt Publishing. Facts 15 chapters, 441 pages, 38€99This book is intended for beginners but more experienced developers can learn a thing or twoThis book covers Hibernate and Spring in relation to persistence Pros The scope of this book is what makes it very interesting. Many books talk about Hibernate and many talk about Spring.

Nicolas Fränkel
Mar 1, 2010 hibernate

Hibernate hard facts – Part 5

This is the 5th post in the Hibernate hard facts focus series. In this article, I will show you how to manage logical DELETE in Hibernate

Nicolas Fränkel
Feb 17, 2010 get hibernate jpa load proxy

Hibernate hard facts - Part 4

This is the 4th post in the Hibernate hard facts focus series. In this article, I will show the subtle differences between get() and load() methods.

Nicolas Fränkel
Dec 13, 2009 convert custom database facts hibernate mapping object type usertype

Hibernate hard facts part 3

This is the 3rd post in the Hibernate hard facts focus series. In the third article of this serie, I will show how to tweak Hibernate so as to convert any database data types to and from any Java type so as to decouple your database model from your object model.

Nicolas Fränkel
Aug 12, 2009 bea business hibernate ibm it jboss mysql open source opensource oracle shark springsource sun vmware

Shark! Shark! in the IT business

Do you remember the classic Atari ST game where you, as a fish, eat other fishes while getting bigger and avoiding bigger fishes to eat you? It seems the last 4 years has seen its share of fishes eat and being eaten.

Nicolas Fränkel
Jun 27, 2009 association bidirectional hibernate

Hibernate hard facts part 2

This is the 2nd post in the Hibernate hard facts focus series. Hibernate is a widely-used Object Relational Mapping framework. Many organizations use it across their projects in order to manage their data access tier. Yet, many developers working on Hibernate don’t fully understand the full measure of its features.

Nicolas Fränkel
Jun 14, 2009 error facts hibernate mistake misunderstanding understanding

Hibernate hard facts part 1

This is the 1st post in the Hibernate hard facts focus series. Hibernate is a widely-used Object Relational Mapping framework. Many organizations use it across their projects in order to manage their data access tier. Yet, many developers working on Hibernate don’t fully understand the full measure of its features.

Nicolas Fränkel
Mar 10, 2009 hibernate jpa persistence

Framework agnostic JPA

With new JEE 5 standard has come the EJB3 specifications. From an historical point of view, EJBs come into 3 different flavors: (i) Entity for persistence, (ii) Session for business logic and (iii) Message-Driven for listeners. Entity EJB are the most time-consuming to develop in their 2.1 version. Apart from the inherent complexity of EJB (local and remote interfaces, homes), developing an EJB 2 is error-prone because of the mapping mechanism.

Nicolas Fränkel
A Java geek © 2008-2026
v. bc04c88300c3ec997ce8470fbff5395dc9e518b1/13264050981
Latest Posts