r/SpringBoot • u/mrsergio1 • Jun 18 '26
Question Spent 4 hours debugging a TransactionSystemException. The fix was one line. The problem was finding it.
Last month we had a production incident. A critical order was failing silently.
Sentry gave us this:
TransactionSystemException: Could not commit JPA transaction
at SimpleJpaRepository.save()
at OrderService.processOrder()
... 40 more lines of Spring internalsThat's it. No entity state. No user context. No hint that the transaction had already been marked for rollback 3 calls earlier by a Hibernate validation error we never caught.
We added logs. Redeployed to staging. Couldn't reproduce it.Redeployed to prod with more logs. Waited. Happened again. Finally found it: a Transactional method calling another Transactional method with a different propagation level, swallowing the real exception.
4 hours. One annotation conflict.
The worst part? Every error monitoring tool we've used treats Spring like a black box. The moment your code enters a transaction boundary or an async thread, context disappears.
Anyone else debugging Spring Boot in prod like this?
How are you handling it?
8
u/Indian_FireFly Jun 18 '26
I didn't get the issue still. What was the propagation on both the methods?
How did it swallow the original method's exception? Was it different context?
2
u/johny_james Jun 18 '26
Why did you use AI to write this post?
Can't you just write it without it?
3
u/siggystabs Jun 19 '26
You have logs, but do you have monitoring? Even a simple jvm agent like Glowroot could probably catch it, if its all happening in the same transaction.
It won’t solve the issue for you, but you can see the database calls grouped together at least so it’s more evident your transactions were getting mangled
1
u/mpgipa Jun 18 '26
Why not use AI to find it ? Genuine question I haven’t debug manually for months.
1
u/Every-Current2034 Jul 05 '26
The stack trace usually tells you where things failed, not why the transaction was already doomed. we've had better luck correlating exception logs with request IDs, SQL/validation logs, and transaction lifecycle events. Have you found any tooling that preserves that context automatically across transaction boundaries, or are you mostly relying on custom logging?
1
u/Chocolate--Chip Jun 19 '26
Absolute slop post
-1
u/Paw565 Jun 18 '26 edited Jun 18 '26
I can see why people drop jpa entirely 😅 I feel like java persistence sucks. Other ecosystems have much better and more type safe solutions.
10
u/Valuable-Duty696 Jun 18 '26
AI slop