Using Narayana JTA under Spring without an XA connection
haskovec Apr 6, 2016 4:12 PMAt one point in my company we went away from XA connections as we had issues with SQLServer 2008. They fundamentally wouldn't scale and were broken for our traffic volume at the time. We are now on SQLServer 2012, but unwilling to revisit that XA decision as it seems like Microsoft hasn't updated their XA packages or JDBC driver at all in the last 3 years. We ended up switching our Datasources in JBoss EAP to be regular JDBC connections, but we still configured for JTA transactions. While their could be atomicity issues this way, this configuration has largely worked for us for a couple of years now in production (We are running EAP-6.4).
I am experimenting with being able to run our app in other containers (like Tomcat) but I wanted to stay with JBoss Transactions. When I look at the documentation this seems like it isn't possible. I started working on a test case in the spring-boot directory of my forked version of the quickstart repository here: GitHub - haskovec/quickstart: The quickstarts for the narayana project. I think I realize why this is failing which is that I am not starting the RecoveryManager service and registering my Datasource with it. It looks like the Recovery Service only accepts an XA datasource.
Currently for our app, though we run on JBoss in production, when our unit tests execute they use Atomikos to provide the JTA so that we can standup a minimal app under the SpringJunitTestRunner. Atomikos allows you to use a NonXA datasource as well with limitations: https://www.atomikos.com/Documentation/NonXaDataSource
I was able to make the same test that failed in the above github repository pass in my atomikos repository test: GitHub - haskovec/atomikos-transaction-test: Test using Atomikos with Spring with a Non-XA connection in JTA mode with r…
My question is: Is there a way to run JBossTM in standalone mode for JTA with a non XA JDBC Driver and have it sort of work, with limitations or is that not at all possible. If the answer is the latter, I will just convert our app to use Atomikos for both unit tests and production so that we have the option to run either on JBoss or any other container, (or in the future when I convert it to Spring Boot, to an embedded tomcat server if we want). My hope is to stay with the JBossTM as it has worked great for us for a couple of years and switching out transaction managers on an application that services up millions of pages a day is a little nerve racking so I was hoping someone here would have a solution for me.
Thanks,
Jeffrey Haskovec