<div dir="ltr">Hello everyone,<div><br></div><div>I think I found a minor defect in the jboss-cli /xa-data-source operation in Widlfly 8. Can anyone confirm this or correct me if I'm wrong? </div><div><br></div><div>Currently the jboss-cli doesn't let you set the jta true/false property on an XA data source. You can set this property on a regular data source, but not an XA one. Is this intentional or a defect?</div>
<div><br></div><div>If it is a defect, I think the problem might be in this file:</div><div><br></div><div><a href="https://github.com/wildfly/wildfly/blob/master/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/Constants.java">https://github.com/wildfly/wildfly/blob/master/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/Constants.java</a><br>
</div><div><br></div><div>You can see on line 419 that DATASOURCE_ATTRIBUTE includes the JTA attribute definition:</div><div><br></div><div><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(51,51,51);line-height:18px">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="" style="font-weight:bold">static</span> <span class="" style="font-weight:bold">final</span> <span class="" style>SimpleAttributeDefinition</span><span class="" style="font-weight:bold">[]</span> <span class="" style>DATASOURCE_ATTRIBUTE</span> <span class="" style="font-weight:bold">=</span> <span class="" style="font-weight:bold">new</span> <span class="" style>SimpleAttributeDefinition</span><span class="" style="font-weight:bold">[]{</span><span class="" style>CONNECTION_URL</span><span class="" style="font-weight:bold">,<br>
</span> <span class="" style>DRIVER_CLASS</span><span class="" style="font-weight:bold">,</span> <span class="" style>Constants</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">DATASOURCE_CLASS</span><span class="" style="font-weight:bold">,</span> <span class="" style>JNDI_NAME</span><span class="" style="font-weight:bold">,<br>
</span> <span class="" style>DATASOURCE_DRIVER</span><span class="" style="font-weight:bold">,<br></span> <span class="" style>NEW_CONNECTION_SQL</span><span class="" style="font-weight:bold">,</span> <span class="" style>URL_DELIMITER</span><span class="" style="font-weight:bold">,<br>
</span> <span class="" style>URL_SELECTOR_STRATEGY_CLASS_NAME</span><span class="" style="font-weight:bold">,</span> <span class="" style>USE_JAVA_CONTEXT</span><span class="" style="font-weight:bold">,<br></span> <span class="" style><b>JTA</b></span><span class="" style="font-weight:bold">,</span> <span class="" style>org</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">jboss</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">as</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">connector</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">subsystems</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">common</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">pool</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">Constants</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">MAX_POOL_SIZE</span><span class="" style="font-weight:bold">,</span></blockquote>
</pre></div><div><br></div><div>But on line 492, the XA_DATASOURCE_ATTRIBUTE doesn't have JTA</div><div><br></div><div><pre style="font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;margin-top:0px;margin-bottom:0px;color:rgb(51,51,51);line-height:18px">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <span class="" style="font-weight:bold">static</span> <span class="" style="font-weight:bold">final</span> <span class="" style>SimpleAttributeDefinition</span><span class="" style="font-weight:bold">[]</span> <span class="" style>XA_DATASOURCE_ATTRIBUTE</span> <span class="" style="font-weight:bold">=</span> <span class="" style="font-weight:bold">new</span> <span class="" style>SimpleAttributeDefinition</span><span class="" style="font-weight:bold">[]{<br>
</span> <span class="" style>Constants</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">XA_DATASOURCE_CLASS</span><span class="" style="font-weight:bold">,</span> <span class="" style>JNDI_NAME</span><span class="" style="font-weight:bold">,</span> <span class="" style>DATASOURCE_DRIVER</span><span class="" style="font-weight:bold">,<br>
</span> <span class="" style>NEW_CONNECTION_SQL</span><span class="" style="font-weight:bold">,</span> <span class="" style>URL_DELIMITER</span><span class="" style="font-weight:bold">,<br></span> <span class="" style>URL_SELECTOR_STRATEGY_CLASS_NAME</span><span class="" style="font-weight:bold">,</span> <span class="" style>USE_JAVA_CONTEXT</span><span class="" style="font-weight:bold">,<br>
</span> <span class="" style>org</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">jboss</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">as</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">connector</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">subsystems</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">common</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">pool</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">Constants</span><span class="" style="font-weight:bold">.</span><span class="" style="color:teal">MAX_POOL_SIZE</span><span class="" style="font-weight:bold">,</span></blockquote>
</pre></div><div><br></div><div>Would just adding "JTA," after USE_JAVA_CONTEXT on line 492 fix this, or is there more that needs to be done? I'm happy to submit a pull request to fix, but it is such a minor change that it might be easier for someone already working in the code to do it.</div>
<div><br></div><div>Thanks for your help and my apologies if this is already been reported or previously discussed.</div><div><br></div><div>Marc Zbyszynski</div><div>Verifi LLC<br></div><div><a href="http://verificoncrete.com/">http://verificoncrete.com/</a><br>
</div></div>