How to activate Hibernate Statistics to analyze performance issues
|

How to activate Hibernate Statistics to analyze performance issues

Did you ever ask yourself why a server request took ages on the production system while your local test system was just fine?Well, we all had these situations, and we will have several more of them in the future. In my experience, strange performance drops are often related to slow database queries. But which query…

JPA 2.1 – 12 features every developer should know
| |

JPA 2.1 – 12 features every developer should know

If you are a regular reader of this blog, you know that I wrote several articles about features and enhancements introduced with JPA 2.1. One thing that was missing, was a general overview about all the changes. So here it is πŸ™‚The following paragraphs provide a description of the 12 features and enhancements introduced with…

5 ways to initialize lazy associations and when to use them
| |

5 ways to initialize lazy associations and when to use them

Lazy loading of associations between entities is a well established best practice in JPA. Its main goal is to retrieve only the requested entities from the database and load the related entities only if needed. That is a great approach if you only need the requested entities. But it creates additional work and can be…

JPA Entity Graphs: How to Dynamically Define and Use an EntityGraph
| |

JPA Entity Graphs: How to Dynamically Define and Use an EntityGraph

This is my second post on Entity Graphs. The first post described the usage of named entity graphs. These can be used to defineΒ a graph of entities and/or attributes at compile time that shall be fetched with a find or query method. Dynamic entity graphs do to the same but in a dynamic way. This…