Fail the build on a @Transactional Spring cannot advise

TestSecurityService
Ya
27 Agosti 2026, 09:14 UTC
Mwandishi
Kamo
Ahadi ya
ef8855e

Two shapes get no transaction advice at all, and neither is visible at a call site or in a unit test: a non-public method, which the proxy cannot intercept, and a REQUIRES_NEW method called from inside its own class, where the call never leaves the instance. Both shipped in this module. The outbound-exchange audit row was a protected REQUIRES_NEW method called from two private helpers — so it joined the caller's transaction, and a FAILED query rolled back the record of its own failure. It passed its unit test the whole time, because constructing a service directly means there is no proxy to be missing. That is exactly why this guard reads the source rather than exercising a bean. Proved it fails before trusting it: dropping the original shape back in as a scratch probe turns the build red with the file and line. A guard nobody has watched fail is a guard nobody knows the shape of. The nested case is allowed when the OUTER method carries the same propagation. DisclosureRecorder.record is REQUIRES_NEW and calls recordAll, also REQUIRES_NEW: the new transaction is already open by then and advising the inner call would open a second for nothing. Correct as written, and its javadoc now says so — the next person to run this check will find the note before they "fix" it into two transactions.

Mabadiliko yote

Je, unaona nini kuhusu usafiri?

Kila moja ya hizi updates ardhi katika nafasi yako ya kazi moja kwa moja. Kuanza bure na kuangalia kukua wiki baada ya wiki.

Kuwa Huru MileleMtazamo wa bei