-
1. Re: CLI rejects xa-data-source-properties in JBoss AS 7.1.0.Beta1
maeste Nov 30, 2011 9:32 AM (in response to r.reimann)It's a change we have made in 7.1. Now xa-datasource-properties are subresources, no more parameter of add operation.
It makes those properties manageable.
regards
S.
-
2. Re: CLI rejects xa-data-source-properties in JBoss AS 7.1.0.Beta1
r.reimann Nov 30, 2011 11:19 AM (in response to maeste)Thanks, for the quick reply. Adding the properties as subresources worked:
/subsystem=datasources/xa-data-source=TestDS/xa-datasource-properties=ServerName:add(value=localhost)
/subsystem=datasources/xa-data-source=TestDS/xa-datasource-properties=PortNumber:add(value=50011)
Sorry if i'm asking beginners questions since it's my first day using AS7 and the CLI but is there a way to bulk add multiple properties at once without repeating the address for each property like above?
I also wonder if (and how) the generic type xa-data-source command still supports xa-datasource-properties in 7.1?
-
3. Re: CLI rejects xa-data-source-properties in JBoss AS 7.1.0.Beta1
maeste Dec 1, 2011 1:08 AM (in response to r.reimann)No there isn't a bulk change, but you can write a cli script of course.
And no, xa-datasource-properties are not supported as part of add command, as said to make them maneageble (add/remove single property on an already created, and disabled, ds)
regards
S.
-
4. Re: CLI rejects xa-data-source-properties in JBoss AS 7.1.0.Beta1
frolovmx Oct 8, 2015 1:08 PM (in response to maeste)Is it possible to congiure xa-datasource using DMR API?
Executing the following operation:
ModelNode op = new ModelNode(); op.get("operation").set ("add"); op.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName); op.get("jndi-name").set("java:jboss/datasources/" + datasourceName); op.get("driver-name").set("oracle"); op.get("enable").set("false"); op.get("xa-datasource-properties").add("URL", "jdbc:oracle:thin:@host:1521:serviceName");
results in
JBAS010469: At least one xa-datasource-property is required for an xa-datasource
If I understand properly, if I would add xa datasource using CLI I would use 2 commands in a batch. Is there something like batch operations in DMR API?
-
5. Re: CLI rejects xa-data-source-properties in JBoss AS 7.1.0.Beta1
frolovmx Oct 9, 2015 2:51 AM (in response to frolovmx)A CLI batch is a composite DRM API operation.
The following code works:
ModelNode compositeOp = new ModelNode();
compositeOp.get("operation").set("composite");
compositeOp.get("address").setEmptyList();
final ModelNode steps = compositeOp.get("steps");
ModelNode step1 = new ModelNode();
step1.get("operation").set ("add");
step1.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName);
step1.get("jndi-name").set("java:jboss/datasources/" + datasourceName);
step1.get("driver-name").set("oracle");
step1.get("enable").set("false");
ModelNode step2 = new ModelNode();
step2.get("operation").set ("add");
step2.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName).add("xa-datasource-properties", "URL");
step2.get("value").set("jdbc:oracle:thin:@host:1521:service");
ModelNode step3 = new ModelNode();
step3.get("operation").set ("add");
step3.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName).add("xa-datasource-properties", "User");
step3.get("value").set("username");
ModelNode step4 = new ModelNode();
step4.get("operation").set ("add");
step4.get("address").add("subsystem", "datasources").add("xa-data-source", datasourceName).add("xa-datasource-properties", "Password");
step4.get("value").set("password");
steps.add(step1).add(step2).add(step3).add(step4);
client.execute(compositeOp);