- Ya
- 5 Septemba 2026, 05:20 UTC
- Mwandishi
- Kamo
- Ahadi ya
- 3bb492b
Two fixes that only make sense together. @RetryOnDbConflict retries a method OUTSIDE its transaction, so each attempt begins a fresh one. Retrying inside the transaction — which is what you get if any of this is subtly wrong — is not a smaller benefit but none at all: a transaction that has seen SQLState 40001 fails every subsequent statement, so each extra attempt re-runs work that cannot commit. It also looks like it is working, which is the dangerous part. The log fills with retries, the method really is called three times, and the error at the end is the one you would have had anyway. So the test counts TRANSACTIONS STARTED, not attempts. Those two numbers are identical in the working case and differ in the broken one, and nothing else separates them. It caught three real defects while this was being written: 1. A plain @Component advisor is invisible to the auto-proxy creator that @EnableTransactionManagement installs, which considers only advisors marked ROLE_INFRASTRUCTURE. Every retry silently did nothing. interceptor chain, so a second proceed() resumed past the transaction interceptor and re-invoked the target directly, inside the failed transaction. Each attempt now gets an invocableClone(). 3. Advice must not alter a method's contract, so a declared checked exception is carried across the retry boundary and rethrown unchanged. Built on plain Spring AOP, not @Aspect, to avoid putting aspectjweaver into sixty images for one interceptor. Second: MemberRightsAppliedService no longer continues when the security-model templates cannot be read. Logging a warning and carrying on sounds like the careful choice and is its opposite — templates are not only a source of extra rights, and a NUKE value is how a model says "off by default", so skipping them leaves a right standing that the organization intends to withhold. The result was then persisted. A transient database hiccup could therefore hand a member access nobody granted, with one WARN line as the only trace. It now throws with the cause attached, and the two entry points carry @RetryOnDbConflict — the realistic cause is a catalog-version bump, and a retry can only happen if the failure is allowed to reach it. 2757 tests green.