-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Add support for @Transactional
in native images
#28717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related to #28688. |
This commit annotates @transactional with @Reflective and registers proxy hints for SpringProxy. Injection of proxied beans via their interfaces still fails in native images with a "No qualifying bean of type MyInterface" error. See spring-projectsgh-28717
I have improved the support for |
As discussed with @sbrannen, we need to replace the |
A dynamic mechanism to register proxy and reflection hints for classes annotated by @transactional is needed instead. See spring-projectsgh-28717
@Transactional
in native-image
@Transactional
in native-image@Transactional
in native images
This commit introduces a TransactionBeanRegistrationAotProcessor in charge of creating the required proxy and reflection hints when @transactional is detected on beans. It also refines DefaultAopProxyFactory to throw an exception when a subclass-based proxy is created in native images since that's unsupported for now (see spring-projectsgh-28115 related issue). Closes spring-projectsgh-28717
When running the
jdbc-tx
sample insb-3.0.x
branch from spring-native, it fails with:This is the run method:
I guess that
@Transactional
doesn't work in native-image.The text was updated successfully, but these errors were encountered: