Gen Web View "Error attempting to determine if transactions are supported"
search cancel

Gen Web View "Error attempting to determine if transactions are supported"

book

Article ID: 376616

calendar_today

Updated On:

Products

Gen Gen - Run Time Distributed

Issue/Introduction

Using a Gen 8.6 Web View Java application (no server) that calls a SQL Server database directly
Deployed to WebSphere Liberty Application Server (not yet officially supported for Gen 8.6 ) after running Build Tool assemble step using Application Server = GENERIC to create the .ear file.

When execute transaction which attempts to access the database receive error:

"TIRM039E: DB last status = DB BaseDBMSManager.getStatement() caught ABException getting connection for: COOP07 Exception: com.ca.gen.abrt.ABException: [Function: DataSourceDBMSManager.connect]Error attempting to determine if transactions are supported: java.sql.SQLRecoverableException: enlist: caught Exception"





The problem does not occur when building the same application for Web Generation instead of Web View i.e. the database access is successful.

Environment

Gen 8.6 Web View
Any application server

Cause

The root cause is not specific to the WebSphere Liberty Application Server.
The server.xml file had been configured with an XA data source i.e.
**********
    <dataSource id="COOP07" jndiName="jdbc/COOP07" type="javax.sql.XADataSource">
        <jdbcDriver libraryRef="MSLib"/>
        <properties.microsoft.sqlserver databaseName="COOP07" serverName="localhost" portNumber="1433" user="user1" password="##########" trustServerCertificate="true"/>
    </dataSource>
    
    <library id="MSLib">
        <file name="C:/Users/Administrator/Documents/Liberty/mssql-jdbc-12.8.1.jre8.jar"/>
    </library>
**********

However the target SQL Server database had not been configured to accept XA transactions.

Resolution

Follow the steps on this Microsoft Learn page for SQL Server and JDBC Understanding XA transactions to enable XA in both the Microsoft Distributed Transaction Coordinator (MS DTC) and the SQL Server instance.

Additional Information

For the Build Tool assemble step using Application Server GENERIC.
The WAR tab option "Use JTA transactions" is disabled for Web Generation/INTERNET clients but for Web View clients the same option is enabled by default. It seems that with "Use JTA transactions" enabled XA was used in the Web View database connection and that is why the error did not occur for the Web Generation application where XA was not used.
Gen EJBs also have similar requirements per doc. page: Working With Enterprise JavaBeans > Java Generation - Multiple Database Support

Related article: Gen EJB under JBoss TIRM170E ("java.sql.SQLException: IJ031070")