Make YdbTransactionInterceptor wiring AOT-compatible#229
Merged
KirillKurdyukov merged 1 commit intoJul 14, 2026
Merged
Conversation
The replacer swapped Spring's `transactionInterceptor` bean for a YdbTransactionInterceptorFactory whose dependencies were supplied via setAutowireMode(AUTOWIRE_BY_TYPE). Spring's AOT engine runs the BeanDefinitionRegistryPostProcessor at build time and freezes the result into generated code, but it does not support the legacy autowire modes, so retryProperties/transactionAttributeSource were never injected. At runtime the factory's getObject() then failed with "retryProperties must be set...". Declare the two dependencies as explicit RuntimeBeanReference property values (resolved by type) instead. Explicit property values are code-generated by AOT and therefore survive, while JIT behavior is unchanged. The factory and post-processor are otherwise untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
@KirillKurdyukov Please set up your personal token, see instructions: https://nda.ya.ru/t/dur-L1y77biDC2 |
There was a problem hiding this comment.
AI Review Summary
Verdict: ✅ No critical issues found
Critical issues
No critical issues found.
Other findings
- Nit | Low: The 4-line block comment (lines 58–61) explaining why
AUTOWIRE_BY_TYPEis replaced could be shortened to two lines, since the commit message already has the full rationale —spring-ydb-retry/src/main/java/tech/ydb/retry/YdbTransactionInterceptorReplacer.java:58
This review was generated automatically. Critical issues require attention; other findings are advisory.
If this comment was useful, please give it a 👍 — it helps us improve the review bot.
|
Analysis performed by claude, claude-opus-4-6. |
KirillKurdyukov
approved these changes
Jul 14, 2026
Collaborator
|
@Eistern hi! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
The replacer swapped Spring's
transactionInterceptorbean for a YdbTransactionInterceptorFactory whose dependencies were supplied via setAutowireMode(AUTOWIRE_BY_TYPE). Spring's AOT engine runs the BeanDefinitionRegistryPostProcessor at build time and freezes the result into generated code, but it does not support the legacy autowire modes, so retryProperties/transactionAttributeSource were never injected. At runtime the factory's getObject() then failed with "retryProperties must be set...".Issue Number: N/A
What is the new behavior?
Declare the two dependencies as explicit RuntimeBeanReference property values (resolved by type) instead. Explicit property values are code-generated by AOT and therefore survive, while JIT behavior is unchanged. The factory and post-processor are otherwise untouched.