Skip to content

Comments

Upgrade agroal from 2.2 to 3.0#924

Merged
hazendaz merged 3 commits intomasterfrom
copilot/fix-agroal-compatibility-issues
Feb 8, 2026
Merged

Upgrade agroal from 2.2 to 3.0#924
hazendaz merged 3 commits intomasterfrom
copilot/fix-agroal-compatibility-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 8, 2026

Problem

Agroal 2.3+ enforces JTA spec: only one "last resource" per transaction. Tests used two local datasources in same transaction—both attempting last resource registration—causing failures.

Solution

Mixed XA + connectable local datasource pattern:

Derby (JtaLocalTest)

// Before: two local datasources (both attempt last resource)
dataSource1 = createLocalDataSource(URL_DB1, manager);
dataSource2 = createLocalDataSource(URL_DB2, manager);

// After: XA + connectable local
dataSource1 = createXADataSource(URL_DB1, manager);  // Full XA support
dataSource2 = createLocalDataSource(URL_DB2, manager);  // LRCO pattern

HSQLDB (SimpleJTATest)

// XA datasource via provider class + properties
.connectionProviderClassName("org.hsqldb.jdbc.pool.JDBCXADataSource")
.xaProperty("url", "jdbc:hsqldb:mem:schema1")

// Local datasource with connectable flag
.jdbcUrl("jdbc:hsqldb:mem:schema2")
.transactionIntegration(new NarayanaTransactionIntegration(tm, tsr, jndi, true))

Changes

  • pom.xml: 2.2 → 3.0
  • BaseDB.java: createXADataSource() now uses EmbeddedXADataSource with xaProperty() configuration
  • BaseDB.java: createLocalDataSource() enables connectable mode for LRCO
  • JtaLocalTest.java: Uses XA for first datasource
  • Utils.java: Uses JDBCXADataSource for HSQLDB

Notes

License headers updated 2025→2026 by license-maven-plugin due to shallow clone workflow making all files appear modified in 2026.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 8, 2026 02:49
Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com>
Co-authored-by: hazendaz <975267+hazendaz@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix compatibility issues with Agroal library and upgrade version Upgrade agroal from 2.2 to 3.0 Feb 8, 2026
Copilot AI requested a review from hazendaz February 8, 2026 03:20
@hazendaz hazendaz marked this pull request as ready for review February 8, 2026 03:24
@coveralls
Copy link

Coverage Status

coverage: 80.363%. remained the same
when pulling 012fed8 on copilot/fix-agroal-compatibility-issues
into 723338e on master.

Copy link
Member

@hazendaz hazendaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work is excellent. Watching AI take this task on and accomplishing it is nothing less than amazing. There was an unfortunate side effect with license plugin which I followed up with AI on why and have reported that to the plugin maintainers, of which I am one. I anticipate we will get support to skip shallow clones involvement in the future. Since AI was able to keep the changes separate, I'm accepting this hard problem it solved here without rework.

@hazendaz hazendaz merged commit 711cae3 into master Feb 8, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants