Financial Transaction Workflow
A Spring/JSP transaction system where approval flows, concurrent updates and reporting reliability required explicit transaction semantics rather than controller-to-database CRUD.
Make the consistency boundary visible.
The database remains the source of truth. Cache and pagination decisions are downstream of transaction semantics, not substitutes for them.
Consistency choices followed workflow behavior.
The useful question was not “which annotation?” but “what can happen concurrently and what result is acceptable?”
Transaction boundary
Used Spring @Transactional around business operations that must commit or roll back together.
Isolation + optimistic locking
MySQL isolation and optimistic locking make conflicting concurrent updates explicit without serializing every request.
Trade-off: concurrency with detectable conflict.Query-path tuning
SQL tuning, indexing and cursor-based pagination keep read cost predictable as result sets grow.
Goal: avoid avoidable database work.Cache discipline
Redis accelerates selected read paths but does not become an accidental alternate source of truth.
Boundary: performance without consistency ambiguity.