Skip to content

Changes DataSource to XADataSource#1

Merged
Karm merged 1 commit into
Karm:java.library.pathfrom
mmadzin:datasource2
Oct 22, 2019
Merged

Changes DataSource to XADataSource#1
Karm merged 1 commit into
Karm:java.library.pathfrom
mmadzin:datasource2

Conversation

@mmadzin
Copy link
Copy Markdown

@mmadzin mmadzin commented Oct 21, 2019

Changes DataSource with XADataSource

@Karm
Copy link
Copy Markdown
Owner

Karm commented Oct 21, 2019

Hello @mmadzin, this is just my fork. Could you open a PR for https://github.com/web-servers/narayana-tomcat/pulls, please?

@mmadzin
Copy link
Copy Markdown
Author

mmadzin commented Oct 21, 2019

I know that this is "just" your fork... however it's the fork we are using in our automation. Is there any reason why we are not using web-servers flavor?

@Karm
Copy link
Copy Markdown
Owner

Karm commented Oct 21, 2019

@mmadzin You are right. It is this never merged PR: web-servers#26

The PR breaks on Tomcat that does not have Natives (vanilla upstream).

Do you know why this is supposed to be configured as XA suddenly?
How come it used to work in the past?

@mmadzin
Copy link
Copy Markdown
Author

mmadzin commented Oct 21, 2019

No idea why this issue showed up now. We do not archive test application which contains configuration file. Hence I can't check what was set before whether the value was / was not changed to XA dynamically.

What I was able to check is that "with current" settings older Tomcats also complain about DataSource type.

@Karm
Copy link
Copy Markdown
Owner

Karm commented Oct 21, 2019

@mmadzin Could you post those failures? Maybe @rsynek could help explaining them...

I am reluctant to accept a change none of us is sure was a bug in the first place. XADataSource and DataSource are two different things. Is this data source really supposed to work with XA Transactions? If it is so, why wasn't it a problem before?

@mmadzin
Copy link
Copy Markdown
Author

mmadzin commented Oct 22, 2019

I believe that the current issue is cause by resource definition. Currently context.xml contains resource with javax.sql.DataSource and Tomcat complains:

...
5-Oct-2019 09:27:51.417 SEVERE [http-nio-8080-exec-2] org.jboss.narayana.tomcat.jta.TransactionalDataSourceFactory.getObjectInstance The expected type of datasource was javax.sql.XADataSource and not javax.sql.DataSource.
15-Oct-2019 09:27:51.418 SEVERE [http-nio-8080-exec-2] org.apache.tomcat.util.modeler.Registry.registerComponent Null component Catalina:type=DataSource,host=localhost,context=/test,class=javax.sql.DataSource,name="transactionalDataSource"
...

I also checked what type is used when test suite runs with docker db instead of db_allocator. The type is set to XADataSource.

Resource configuration when Docker db is used.

<Resource auth="Container" description="Transactional Driver Data Source" factory="org.jboss.narayana.tomcat.jta.TransactionalDataSourceFactory" initialSize="10" jmxEnabled="true" logAbandoned="true" maxAge="30000" maxIdle="16" maxTotal="4" maxWaitMillis="10000" minIdle="8" name="transactionalDataSource" password="narayana_pass" removeAbandoned="true" removeAbandonedTimeout="60" testOnBorrow="true" transactionManager="TransactionManager" transactionSynchronizationRegistry="TransactionSynchronizationRegistry" type="javax.sql.XADataSource" uniqueName="transactionalDataSource" username="narayana_user" validationQuery="select 1" xaDataSource="myDataSource"/>

@Karm Karm merged commit 2b3f96d into Karm:java.library.path Oct 22, 2019
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.

2 participants