Blog

Page 365 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Spring - @Transactional - What happens in background?
javaspring

Spring - @Transactional - What happens in background?

Published on September 2, 2023

# 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

Cover Image for How to respond with an HTTP 400 error in a Spring MVC @ResponseBody method returning String
javaspringspring-mvc

How to respond with an HTTP 400 error in a Spring MVC @ResponseBody method returning String

Published on September 2, 2023

# 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

Cover Image for Downloading a file from spring controllers
downloadfilejavaspring

Downloading a file from spring controllers

Published on September 2, 2023

# 📥 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

Cover Image for Spring @Transactional - isolation, propagation
javaspring

Spring @Transactional - isolation, propagation

Published on September 2, 2023

# 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

Cover Image for What in the world are Spring beans?
javaspring

What in the world are Spring beans?

Published on September 2, 2023

# 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

Cover Image for How can I log SQL statements in Spring Boot?
hibernatejavaspring

How can I log SQL statements in Spring Boot?

Published on September 2, 2023

# 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

Cover Image for How to solve the “failed to lazily initialize a collection of role” Hibernate exception
hibernatejavajspspringspring-mvc

How to solve the “failed to lazily initialize a collection of role” Hibernate exception

Published on September 2, 2023

🔍 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,

Cover Image for Where does the @Transactional annotation belong?
annotationsjavaspring

Where does the @Transactional annotation belong?

Published on September 2, 2023

# 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

Cover Image for How does autowiring work in Spring?
javaspringspring-mvc

How does autowiring work in Spring?

Published on September 2, 2023

# 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.

Blog | Matheus Mello