Skip to content

Conversation

@czpilar
Copy link

@czpilar czpilar commented Apr 4, 2025

As part of the migration to jakarta.transaction-api, we intend to use BasicManagedDataSource with the jakarta package instead of javax. I haven't seen any activity initiated for this migration, so please consider my pull request as a potential solution for the transition.

@jonesbusy
Copy link

Any news here?

@garydgregory
Copy link
Member

Hello @czpilar
Would you please rebase on git master. I'll try to take a look this weekend and see what this means regarding compatibility.

@czpilar czpilar force-pushed the jakarta-transaction branch from 83adfa0 to d45bcce Compare November 21, 2025 12:07
@garydgregory
Copy link
Member

Hello @czpilar
The PR doesn't compile on Java 8.

@czpilar
Copy link
Author

czpilar commented Nov 21, 2025

Hi @garydgregory,
I am still working on the rebase as I am having an issue with the rat-check execution on Windows.

I know it does not compile on Java 8. This is because narayana-jta and geronimo-transaction do not have Jakarta versions compiled with Java 8, only with Java 11.

@czpilar czpilar force-pushed the jakarta-transaction branch 2 times, most recently from 6b6a71c to 2437055 Compare November 21, 2025 13:12
@garydgregory
Copy link
Member

Hello @czpilar
Thank you for the updates but it still fails on Java 8. Please build locally before you push.

Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.14.1:testCompile (default-testCompile) on project commons-dbcp2: Compilation failure
Error:  /home/runner/work/commons-dbcp/commons-dbcp/src/test/java/org/apache/commons/dbcp2/managed/TestBasicManagedDataSource.java:[43,58] cannot access com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple
Error:    bad class file: /home/runner/.m2/repository/org/jboss/narayana/jta/narayana-jta/6.0.3.Final/narayana-jta-6.0.3.Final.jar(com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionManagerImple.class)
Error:      class file has wrong version 55.0, should be 52.0
Error:      Please remove or make sure it appears in the correct subdirectory of the classpath.
Error:  -> [Help 1]

@czpilar
Copy link
Author

czpilar commented Nov 21, 2025

Hi @garydgregory,
rebased on master branch....

I was able to fix the issue with geronimo-transaction, which is now compatible with Java 8, but unfortunately narayana-jta is not.

The latest narayana-jta version compatible with Java 8 is 5.12.7.Final, which still requires the javax variant. Starting from release 5.13.1.Final, it is compatible only with Java 11 (still javax), and from 6.0.1.Final onward it requires Java 11 and the jakarta variant.

So I am not sure how to solve this.

@garydgregory
Copy link
Member

Hello @czpilar
Hm, yeah, I see that now. Let me look consider this over the next couple of days...

@czpilar
Copy link
Author

czpilar commented Nov 21, 2025

Hi @garydgregory,

One solution would be to remove:

  • the test TestBasicManagedDataSource.testTransactionSynchronizationRegistry
  • the entire test class TestConnectionWithNarayana

Then, once dbcp is on Java 11, we can add them back.

@garydgregory
Copy link
Member

Hello @czpilar
I'm going to push a release candidate for the current state of git master, and they will clear the decks for this type of change. The component is overdue for a release anyway.

@czpilar
Copy link
Author

czpilar commented Nov 21, 2025

Hi @garydgregory, wait... I've found out there is narayana-jta-jakarta compatible with Java 8 and jakarta... just testing...

@czpilar czpilar force-pushed the jakarta-transaction branch from 2437055 to 28ccddc Compare November 21, 2025 14:25
@czpilar
Copy link
Author

czpilar commented Nov 21, 2025

Hi @garydgregory - just pushed the latest changes and everything should be compatible with Java 8 and jakarta...

@czpilar
Copy link
Author

czpilar commented Nov 21, 2025

Hi @garydgregory,

I am not sure why it is failing right now… Japicmp is complaining about the changes from javax to jakarta, for example:

org.apache.commons.dbcp2.managed.TransactionRegistry.TransactionRegistry(javax.transaction.TransactionManager,javax.transaction.TransactionSynchronizationRegistry): CONSTRUCTOR_REMOVED

Well, this PR is specifically about the migration from javax to jakarta, so these changes are expected. Please take a look at it.

The mvn clean package command works correctly on all Java versions 8, 11, 17, 21, and 25 — I have tested them locally.

@garydgregory
Copy link
Member

garydgregory commented Nov 21, 2025

@czpilar
OK so it seems this breaks binary compatibility which means a major version change. I'll ponder the consequences...

@czpilar czpilar force-pushed the jakarta-transaction branch from 28ccddc to 7ce1d59 Compare November 21, 2025 16:57
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