Monthly Archives: August 2014

Understanding the Hibernate session cache

When you use Hibernate, you do so via a session. It is well known that the session acts as a first level cache, but sometimes this can cause confusing behaviour. Let’s look at a simple example. Suppose I have Customer … Continue reading

Posted in Hibernate | Tagged | Leave a comment

Understanding Hibernate session flushing

When you interact with Hibernate, you do so via a Hibernate session. Hibernate sessions are flushed to the database in three situations: When you commit a (Hibernate) transaction. Before you run a query. When you call session.flush(). However, it is … Continue reading

Posted in Hibernate | Tagged | 2 Comments

Hibernate query limitations and correlated sub queries

It’s well known that one of the key limitations of writing queries in Hibernate, using either HQL or criteria, is that you cannot write queries that have a join in the from clause. What is less well known is that … Continue reading

Posted in Hibernate | Tagged | 1 Comment