Transactional Articles
2 articles about Transactional. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Implement Transaction Management with @Transactional in Spring Boot + MyBatis - The Mechanism of SqlSession and DataSourceTransactionManager
MyBatis has no persistence context, so @Transactional only controls the commit/rollback timing of SqlSession. This article verifies with working code the thread binding of SqlSessionTemplate, visualization through logs, combined use with JdbcTemplate, and the pitfall of checked exceptions.
-
Why @Transactional, @Cacheable, and @Async Don't Work in Spring Boot - Understanding AOP Proxies and Self-Invocation to Fix It
@Transactional doesn't roll back, @Cacheable hits the DB every time, @Async runs synchronously. All of these are caused by how Spring AOP proxies work. This article isolates five patterns - self-invocation, private/final methods, new, and missing enablement - with reproducible code and diagnostic steps, then compares workarounds such as extracting to a separate Bean, self-injection, and TransactionTemplate.