Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-26363

(7.4.z) WFTC-141 - Wildfly-transaction-client doesn't log that the transaction timeout wasn't set, when the driver returns false.

XMLWordPrintable

    • False
    • None
    • False
    • -
    • Hide

      Modified CMT quickstart could be used as reporoducer.

      You just need to add for example Sybase driver and datasource

      Steps:

      • start jboss-cli
      • module add --name=jconn4 --resources=PATH_TO_JDBC_JAR --dependencies="javax.api,javax.transaction.api"
      • /subsystem=datasources/jdbc-driver=jconn4:add(driver-name=jconn4,driver-module-name=jconn4,driver-xa-datasource-class-name=com.sybase.jdbc4.jdbc.SybXADataSource, driver-class-name=om.sybase.jdbc4.jdbc.SybDriver)
      • xa-data-source add --name=SybaseDS --jndi-name=java:jboss/xa-datasources/SybaseDS --driver-name=jconn4 --xa-datasource-class=com.sybase.jdbc4.jdbc.SybXADataSource --xa-datasource-properties={"ServerName"=>"HOST_NAME","DatabaseName"=>"DB_NAME","PortNumber"=>"DB_PORT",} --password=DB_PASSWORD --user-name=DB_USER --valid-connection-checker-class-name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseValidConnectionChecker" --validate-on-match=true --exception-sorter-class-name="org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseExceptionSorter"
      • /subsystem=ee/service=default-bindings:write-attribute(name=datasource,value=SybaseDS)
      • deploy the CMT quickstart
      • go to http://localhost:8080/addCustomer.jsf and add a new customer
      • The log message should be shown
      • You can always inspect how the server behaves by starting it in debug mode and setting a breakpoint to org.wildfly.transaction.client.LocalTransaction.enlistResource(final XAResource xaRes) - line 171
      Show
      Modified CMT quickstart could be used as reporoducer. You just need to add for example Sybase driver and datasource Steps: start jboss-cli module add --name=jconn4 --resources=PATH_TO_JDBC_JAR --dependencies= "javax.api,javax.transaction.api" /subsystem=datasources/jdbc-driver=jconn4:add(driver-name=jconn4,driver-module-name=jconn4,driver-xa-datasource- class- name=com.sybase.jdbc4.jdbc.SybXADataSource, driver- class- name=om.sybase.jdbc4.jdbc.SybDriver) xa-data-source add --name=SybaseDS --jndi-name=java:jboss/xa-datasources/SybaseDS --driver-name=jconn4 --xa-datasource-class=com.sybase.jdbc4.jdbc.SybXADataSource --xa-datasource-properties={ "ServerName" => "HOST_NAME" , "DatabaseName" => "DB_NAME" , "PortNumber" => "DB_PORT" ,} --password=DB_PASSWORD --user-name=DB_USER --valid-connection-checker- class- name= "org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseValidConnectionChecker" --validate-on-match= true --exception-sorter- class- name= "org.jboss.jca.adapters.jdbc.extensions.sybase.SybaseExceptionSorter" /subsystem=ee/service= default -bindings:write-attribute(name=datasource,value=SybaseDS) deploy the CMT quickstart go to http://localhost:8080/addCustomer.jsf and add a new customer The log message should be shown You can always inspect how the server behaves by starting it in debug mode and setting a breakpoint to org.wildfly.transaction.client.LocalTransaction.enlistResource(final XAResource xaRes) - line 171

      As you can see in https://github.com/wildfly/wildfly-transaction-client/blob/1.1.17.Final/src/main/java/org/wildfly/transaction/client/LocalTransaction.java#L176, the output of setTransactionTimeout is being ignored.

      Based on https://docs.oracle.com/javaee%2F6%2Fapi%2F%2F/javax/transaction/xa/XAResource.html#setTransactionTimeout(int), the output of this function determines, whether this function was successful.

      the transaction client do log that the setTransactionTimeout was not successful in case of exception being thrown, but not in case of false returned

              lvydra Lukas Vydra
              ogerzica@redhat.com Ondrej Gerzicak
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated:
                Resolved: