Repository navigation
fix(creator): guard setReapTimeout call for Atomikos 6 (#822) - #823
Merged
Merged
Conversation
docs: formalize the main/dev branch model and the contribution flow
… retargeted docs links) Brings in: - README: point readers to the Wiki FAQ before filing issues (2ecad53) - skills/dynamic-datasource: open Agent Skill for installation and troubleshooting, plus the README AI-assistant section (34d0b63) - README: documentation links retargeted to the new free docs site with zh/en switcher and versioned docs (7b7d7f2)
Atomikos 6.0.0 - the first jakarta line, and the only choice for Spring Boot 3/4 apps - removed AtomikosDataSourceBean#setReapTimeout(int). The creator is compiled against Atomikos 4.0.6, so the build cannot catch it, and every createDataSource call fails at runtime with NoSuchMethodError. Look the method up once and only invoke it when it exists: Atomikos 4/5 behave exactly as before, and on Atomikos 6 the data source is created with the reapTimeout value simply not applied. Verified against live classpaths: with the 6.0.1 jars the old code fails with NoSuchMethodError and the fixed code creates the bean; with the 4.0.6 jars the fixed code still applies reapTimeout as before.
|
感谢贡献!本仓库的日常开发分支是 Thanks for contributing! Please retarget this PR from |
|
感谢你的第一个 PR!/ Thanks for your first pull request! |
Closed
3 tasks done
Member
|
nice |
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.
Atomikos 6.0.0 - the first jakarta line, and the only choice for Spring Boot 3/4 apps - removed
AtomikosDataSourceBean#setReapTimeout(int).AtomikosDataSourceCreatorstill calls it directly and is compiled against Atomikos 4.0.6 (gradle/libs.versions.toml), so the build cannot catch the missing method: with Atomikos 6 on the classpath everycreateDataSource(...)fails at runtime withNoSuchMethodError: setReapTimeout(int)and the application does not start. All the other setters the creator uses still exist in 6.0.1 (verified with javap); onlysetReapTimeoutis gone.Fix: look
setReapTimeout(int)up once in a static field and only invoke it when it exists, the same idea asHikariDataSourceCreatorlooking upcopyState/copyStateTo. Atomikos 4/5 behave exactly as before; on Atomikos 6 the data source is created and thereapTimeoutvalue is simply not applied (the bean's own default).Verification (Windows, JDK 17/21) with the real jars, no Spring involved:
new AtomikosDataSourceCreator(new AtomikosConfig()).createDataSource(prop)returns anAtomikosDataSourceBeanwithreapTimeoutapplied - unchanged behavior.transactions*,atomikos-util,jakarta.transaction-api) first on the classpath: before this change the call fails withNoSuchMethodError: 'void com.atomikos.jdbc.AtomikosDataSourceBean.setReapTimeout(int)'; after the change the bean is created successfully.