Sitemap

A humble place to learn Java and Programming better.

7 min readOct 17, 2025

Our Spring Boot app was restarting itself every 6 hours.

No errors. No exceptions. Just a silent crash at 4AM, 10AM, 4PM, 10PM. Like clockwork.

We thought it was AWS. Then we blamed Docker. Then we rewrote half the codebase.

🧩 If you enjoy these deep-dive stories, you might like some of the notes I keep around while working on Spring systems:
• Grokking the Spring Boot Interview → https://gumroad.com/a/134347923/hrUXKY
• Spring Boot Troubleshooting Cheatsheet → https://gumroad.com/a/416513171/ggwlgd
• 250+ Spring Certification Practice Questions → https://gumroad.com/a/134347923/sygyq

These have saved me countless hours chasing weird bean issues and context reload bugs.

The real culprit? A single @Scheduled annotation and Spring's dirty little secret about thread pools.

Press enter or click to view image in full size

How It Started: The Innocent Cron Job

We needed a background job. Something simple. Clean up expired sessions every 5 minutes.

@Component
public class SessionCleanupJob {

@Scheduled(fixedRate = 300000) // 5 minutes
public void cleanupExpiredSessions() {
sessionRepository.deleteExpiredSessions()…

Create an account to read the full story.

The author made this story available to Medium members only.
If you’re new to Medium, create a new account to read this story on us.

Or, continue in mobile web
Already have an account? Sign in
Javarevisited

Published in Javarevisited

A humble place to learn Java and Programming better.

Devrim Ozcay

Written by Devrim Ozcay

Software Engineer , Writing real stories from the software trenches. Software, performance, and chaos in production. ✍️ Turning bugs into lessons worth reading.

Responses (2)

To respond to this story,
get the free Medium app.

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
The Spring Framework has lots of off the shelf features that look like they will make application development faster. The problem I have with the framework is that it is really heavy weight. It can also be difficult to understand because things take…

75