Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-12161

The expression for the value of share-prepared-statements does not work in XA datasource .

XMLWordPrintable

    • Hide
      • Add system property like below :
        --------------------------------
        </extensions>
        <system-properties>
        <property name="expression_any" value="true"/>
        </system-properties>
        --------------------------------
      • Configure XA datasource like below , then try restart eap .

      --------------------------------------
      <xa-datasource jndi-name="java:jboss/datasources/ExampleXADS" pool-name="ExampleXADS">
      <driver>h2</driver>
      <xa-datasource-property name="URL">jdbc:h2:mem:test</xa-datasource-property>
      .
      .

      <statement>
      <share-prepared-statements>${expression_any}</share-prepared-statements>
      </statement>
      </xa-datasource>
      ---------------------------------------

      Show
      Add system property like below : -------------------------------- </extensions> <system-properties> <property name="expression_any" value="true"/> </system-properties> -------------------------------- Configure XA datasource like below , then try restart eap . -------------------------------------- <xa-datasource jndi-name="java:jboss/datasources/ExampleXADS" pool-name="ExampleXADS"> <driver>h2</driver> <xa-datasource-property name="URL">jdbc:h2:mem:test</xa-datasource-property> . . <statement> <share-prepared-statements>${expression_any}</share-prepared-statements> </statement> </xa-datasource> ---------------------------------------

      • Although , the "expressions-allowed" is true for "share-prepared-statements" , the expression for it does not work .

      --------------------------------------------
      [standalone@localhost:9990 /] /subsystem=datasources/xa-data-source=ExampleXADS:read-resource-description()

      "share-prepared-statements" =>

      { "type" => BOOLEAN, "description" => "Whether to share prepared statements, i.e. whether asking for same statement twice without closing uses the same underlying prepared statement", "expressions-allowed" => true, "required" => false, "nillable" => true, "default" => false, "access-type" => "read-write", "storage" => "configuration", "restart-required" => "all-services" }

      ,

      ---------------------------------------------

      • It shows below error if we set expression for share-prepared-statements .

      ---------------------------------------------
      18:32:07,698 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool – 41) WFLYCTL0013: Operation ("add") failed - address: ([
      ("subsystem" => "datasources"),
      ("xa-data-source" => "ExampleXADS")
      ]): java.lang.IllegalArgumentException
      at org.jboss.dmr.ModelValue.asBoolean(ModelValue.java:69)
      at org.jboss.dmr.ModelNode.asBoolean(ModelNode.java:324)
      at org.jboss.as.connector.subsystems.datasources.DataSourceModelNodeUtil.xaFrom(DataSourceModelNodeUtil.java:292)
      at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceAdd.secondRuntimeStep(AbstractDataSourceAdd.java:298)
      at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceAdd$1.execute(AbstractDataSourceAdd.java:134)
      at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
      at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
      at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
      at org.jboss.as.controller.ParallelBootOperationStepHandler$ParallelBootTask.run(ParallelBootOperationStepHandler.java:384)
      at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
      at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1349)
      at java.lang.Thread.run(Thread.java:748)
      at org.jboss.threads.JBossThread.run(JBossThread.java:485)

      ---------------------------------------------

      • However , it works in a non-xa datasource .

              thofman Tomas Hofman
              thofman Tomas Hofman
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: