Blog
Page 365 of my articles, tutorials, and thoughts
Latest Articles
Spring - @Transactional - What happens in background?
# Spring - @Transactional - What happens in background? Do you ever wonder what actually happens when you annotate a method with `@Transactional` in Spring? Sure, you know that Spring will wrap that method in a transaction, but there may still be some lin
How to respond with an HTTP 400 error in a Spring MVC @ResponseBody method returning String
# How to Respond with an HTTP 400 Error in a Spring MVC @ResponseBody Method Returning String 🤔 So you're using Spring MVC for a simple JSON API, and you want to know how to respond with an HTTP 400 error in a Spring MVC `@ResponseBody` method when the m
Downloading a file from spring controllers
# 📥 A Guide to Downloading Files from Spring Controllers 🌸 Have you ever had the need to allow users to download files from your website? Perhaps a PDF generated dynamically within your code? 🧐 In this blog post, we'll explore the common issues related
Spring @Transactional - isolation, propagation
# Understanding Spring @Transactional: Isolation and Propagation Explained with Real-World Examples <p>Imagine this: you're designing a banking application and you have a method that transfers money from one account to another. Now, what if two threads si
What in the world are Spring beans?
# What in the world are Spring beans? 🌱 Have you ever stumbled upon the term "Spring beans" while exploring Grails documentation or reading tech books, only to find yourself scratching your head in confusion? Don't worry, you're not alone! Many developer
How can I log SQL statements in Spring Boot?
# How to Log SQL Statements in Spring Boot Do you want to log those SQL statements in your Spring Boot application but they just won't show up in your log file? 😮 Don't worry, I've got your back! In this blog post, I'll walk you through the common issues
How to solve the “failed to lazily initialize a collection of role” Hibernate exception
🔍 Introducing the “failed to lazily initialize a collection of role” Hibernate Exception Are you encountering the dreaded "failed to lazily initialize a collection of role" Hibernate exception? You're not alone! This error is quite common, but fear not,
Where does the @Transactional annotation belong?
# Where does the `@Transactional` annotation belong? 🤔 You may have come across the `@Transactional` annotation in your Java Spring projects and wondered where it should be placed. Should it be used in the `DAO` classes, their methods, or the Service cla
How does autowiring work in Spring?
# How Does Autowiring Work in Spring? 🌱 Have you ever been confused about how the inversion of control (IoC) works in Spring? Don't worry, you're not alone! Autowiring is a powerful feature in Spring that can simplify your code and make your life easier.





