Skip to content
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

Refine SQLErrorCodesFactory reachability on native images #29294

Closed
sdeleuze opened this issue Oct 10, 2022 · 0 comments
Closed

Refine SQLErrorCodesFactory reachability on native images #29294

sdeleuze opened this issue Oct 10, 2022 · 0 comments
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Milestone

Comments

@sdeleuze
Copy link
Contributor

SQLErrorCodeSQLExceptionTranslator#hasUserProvidedErrorCodesFile implementation does not currently allow to avoid SQLErrorCodesFactory constructor to be reachable from a native image POV when there is no custom org/springframework/jdbc/support/sql-error-codes.xml provided by the user.

With a small refactoring introducing a SQLErrorCodeSQLExceptionTranslator#USER_PROVIDED_ERROR_CODES_FILE_PRESENT static field and making SQLErrorCodesFactory#instance initialization lazy, it is possible to not include SQLErrorCodesFactory constructor by default in native images, avoiding to ship XmlBeanDefinitionReader and related transitive dependencies.

@sdeleuze sdeleuze added in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement theme: aot An issue related to Ahead-of-time processing labels Oct 10, 2022
@sdeleuze sdeleuze added this to the 6.0.0-RC1 milestone Oct 10, 2022
@sdeleuze sdeleuze self-assigned this Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) theme: aot An issue related to Ahead-of-time processing type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant