Featured image
|

Optimizing Eager Fetch with Spring Data and EntityGraph Annotation

The LazyInitializationException is a common occurrence when using Hibernate. It typically happens when you access a lazy-loaded association outside of the persistence context in which it was loaded. I will show you how to prevent this exception without compromising the performance of your application. Through the lens of Spring Data, I will explain how to resolve this challenge with a handy annotation: @EntityGraph. Implementing this strategy allows you to optimize both for efficiency and effectiveness, avoiding one of the common pitfalls in Hibernate.

Rx Observable Contract

Observable contract describes what assumptions are safe to make about interactions between an Observable and an Observer. Originally presented by Microsoft as a set of Rx design principles, it’s been formalised and captured in Rx documentation. This post highlights essential parts of the contracts and provides code examples for better understanding. The Contract In my…

Observer Pattern in RxJava

One of my previous posts about back pressure mentions a concept of an Observable without providing many details. This post is a deeper dive into how the Observer pattern is applied in the world of reactive programming. Observer Pattern: Pros and Cons First off, let’s have a look at the Observer Pattern to see what problem…