mailwal

I broke everything.

Thorben

I want to admit something.

I broke our customer's product management application🤭

At the beginning of my career, I was part of a team responsible for a mobile phone operator's product and account management software.

And after we deployed our latest release, nothing worked.

Seriously, the entire product management application was unusable.

Our project manager went crazy and we spent 2 stressful days fixing my stupid bug and shipping a new release.

Here's a sneaky software development hack:

Make sure you test your application with a similar dataset to what you're running in production. You’ll be less likely to take down the entire system accidentally.

Here’s what happened.

Are you familiar with lazy fetching in JPA? And the disastrous side effects it can cause?

I thought I knew about it, but I still made a small mistake that broke the entire application.

We had modeled a lazily fetched to-many association between two entity classes. In the business code, I called the size() method on that association. And that, of course, forced Hibernate to fetch all its elements.

To make it even worse, all this worked fine on my machine!

I had tested it with a small data set, and everything looked fine.

But in production, this forced Hibernate to fetch a few million records. Unsurprisingly, this operation didn't return until the transaction timeout rolled back the entire transaction.

See, I've been working with Hibernate and similar frameworks for over 20 years and sometimes things still go wrong.

But I make fewer mistakes than I used to.

And it's my 20 years of experimentation to see what works (and what doesn't) that I want to share with you inside the Persistence Hub.

I have built dozens of persistence layers myself and supported the implementation of hundreds of them as a consultant, coach, and trainer...

...so I am constantly testing and trying the latest features to find the best ones for different scenarios and understand how they interact with each other and react to different datasets.

As a member of the Persistence Hub, you'll benefit from that experience 'transplanted' into your project, as well as the necessary concepts to build scalable and maintainable persistence layers.

Click here to check out the Persistence Hub.

Speak soon,

Thorben

PS. Let's cut the learning curve out of your persistence layer. I'm sharing with you what is actually working and how to combine the features available in your specific version of each framework to get the best results. Click here to find out more and join today.

Thorben Janssen, Elser Bruch 63, 33106, Paderborn, Germany