Skip to content

fix(creator): guard setReapTimeout call for Atomikos 6 (#822) - #823

Merged
huayanYu merged 4 commits into
baomidou:devfrom
Lyin-OTTF:fix/atomikos6-reap-timeout
Oct 20, 2026
Merged

huayanYu merged 4 commits into
baomidou:devfrom
Lyin-OTTF:fix/atomikos6-reap-timeout

Conversation

@Lyin-OTTF

Copy link
Copy Markdown

Atomikos 6.0.0 - the first jakarta line, and the only choice for Spring Boot 3/4 apps - removed AtomikosDataSourceBean#setReapTimeout(int). AtomikosDataSourceCreator still 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 every createDataSource(...) fails at runtime with NoSuchMethodError: setReapTimeout(int) and the application does not start. All the other setters the creator uses still exist in 6.0.1 (verified with javap); only setReapTimeout is gone.

Fix: look setReapTimeout(int) up once in a static field and only invoke it when it exists, the same idea as HikariDataSourceCreator looking up copyState/copyStateTo. Atomikos 4/5 behave exactly as before; on Atomikos 6 the data source is created and the reapTimeout value is simply not applied (the bean's own default).

Verification (Windows, JDK 17/21) with the real jars, no Spring involved:

  • Repo default classpath (Atomikos 4.0.6): new AtomikosDataSourceCreator(new AtomikosConfig()).createDataSource(prop) returns an AtomikosDataSourceBean with reapTimeout applied - unchanged behavior.
  • Same code with the Atomikos 6.0.1 jars (transactions*, atomikos-util, jakarta.transaction-api) first on the classpath: before this change the call fails with NoSuchMethodError: 'void com.atomikos.jdbc.AtomikosDataSourceBean.setReapTimeout(int)'; after the change the bean is created successfully.

huayanYu and others added 4 commits October 14, 2026 14:55
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.
@Lyin-OTTF
Lyin-OTTF requested a review from huayanYu as a code owner October 19, 2026 02:31
@github-actions

Copy link
Copy Markdown

感谢贡献!本仓库的日常开发分支是 dev:请把本 PR 的目标分支从 main 改为 dev(标题右侧 Edit → base 分支)。改好后请忽略本条提醒。

Thanks for contributing! Please retarget this PR from main to dev — main only receives release merges from dev. You can change the base branch via Edit next to the title.

@github-actions

Copy link
Copy Markdown

感谢你的第一个 PR!/ Thanks for your first pull request!
提交前请阅读 CONTRIBUTING.md;涉及 @ds 解析、数据源切换栈语义、事务模式的改动,
需同时保持 v1/v3/v4 三套测试有效。

@github-actions github-actions Bot added the core dynamic-datasource core modules label Oct 19, 2026
@Lyin-OTTF
Lyin-OTTF changed the base branch from main to dev October 19, 2026 03:17
@huayanYu
huayanYu merged commit 2ea99ea into baomidou:dev Oct 20, 2026
13 checks passed
@huayanYu

Copy link
Copy Markdown
Member

nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core dynamic-datasource core modules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants