Description of problem: Cannot disable a Datasource or XADatasource in standalone mode. It's back to enabled state after server reload. Version-Release number of selected component (if applicable): 6.1 How reproducible: Always Steps to Reproduce: Use the http management interface or the CLI 1.Create a Datasource of XADatasource 2.Disable it 3.The response indicates a server reload is required 4.Execute the reload operation Actual results: The datasource is back to enabled state Expected results: The datasource should be in disabled state
In domain mode, when you disable the Datasource in the profile, the managed servers indicate they need a restart. When you do it, the Datasource node still appear disabled in the profile node, but appear enabled in managed server nodes.
Same behavior in domain mode for XADatasource
Stefano, Can you get this resolved for the next EAP build cutoff? November 8.
By following steps to reproduce I got: [standalone@localhost:9999 /] data-source add --name=Test2 --driver-name=h2 --enabled=true --jndi-name=java:jboss/datasources/Test2 --connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 [standalone@localhost:9999 /] data-source disable --name=Test2 operation-requires-reload true process-state reload-required [standalone@localhost:9999 /] re read-attribute read-operation reload [standalone@localhost:9999 /] reload [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => false } [standalone@localhost:9999 /] but there is another problem: [standalone@localhost:9999 /] data-source add --name=Test2 --driver-name=h2 --enabled=true --jndi-name=java:jboss/datasources/Test2 --connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => false } datasource is not enabled, it requires restart/reload, but it doesn't notifies user. [standalone@localhost:9999 /] reload [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => true } Is it part of this issue or is it another issue? Should I create new BZ?
enabled attribute is read-only attribute (as read-resource-description describe), so even if you set it in the command it will be ignored, and datasources are always created as disabled, requiring an explicit :enable operation to be enabled runtime w/o a reload. note that special attribute allow-resource-service-restart=true avoid the requirement of :reload for :enable and :disable operation. See as an example: /subsystem=datasources/data-source=ExampleDS:disable{allow-resource-service-restart=true}
The CLI command clearly indicates the intent that the datasource be enabled: [standalone@localhost:9999 /] data-source add --name=Test2 --driver-name=h2 --enabled=true --jndi-name=java:jboss/datasources/Test2 --connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 A big part of the point of high level CLI commands is they should hide all the low level details from the user. So if the intent of the high level command was the datasource should be enabled in the runtime when the command returns, there's a bug that needs fixing. There's a general issue with CLI high level commands not providing all the response data to the user that low level commands do. But that's beyond the scope of this particular issue. @Martin: Is the Comment 10 behavior a regression, or something that never behaved the way you expect?
@Brian: I've just never noticed this behavior. It isn't regression. @Stefano: I can't reproduce this issue on EAP 6.1.0? Any idea what I'm doing wrong? EAP 6.1.0 Steps to Reproduce: 1.Create a Datasource of XADatasource [standalone@localhost:9999 /] data-source add --name=Test2 --driver-name=h2 --jndi-name=java:jboss/datasources/Test2 --connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 2.Disable it [standalone@localhost:9999 /] data-source disable --name=Test2 operation-requires-reload true process-state reload-required 3.The response indicates a server reload is required 4.Execute the reload operation [standalone@localhost:9999 /] reload Actual results: The datasource is back to enabled state Expected results: The datasource should be in disabled state ^------ this is not true, datasource is disabled [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => false } EAP 6.1.1 Steps to Reproduce: 1.Create a Datasource of XADatasource [standalone@localhost:9999 /] data-source add --name=Test2 --driver-name=h2 --jndi-name=java:jboss/datasources/Test2 --connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 2.Disable it [standalone@localhost:9999 /] data-source disable --name=Test2 operation-requires-reload true process-state reload-required 3.The response indicates a server reload is required 4.Execute the reload operation [standalone@localhost:9999 /] reload Actual results: The datasource is back to enabled state Expected results: The datasource should be in disabled state ^-- this is not true, datasource is disabled [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => false } EAP 6.2.0.CR1 Steps to Reproduce: 1.Create a Datasource of XADatasource [standalone@localhost:9999 /] data-source add --name=Test2 --driver-name=h2 --jndi-name=java:jboss/datasources/Test2 --connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 2.Disable it [standalone@localhost:9999 /] data-source disable --name=Test2 operation-requires-reload true process-state reload-required 3.The response indicates a server reload is required 4.Execute the reload operation [standalone@localhost:9999 /] reload Actual results: The datasource is back to enabled state Expected results: The datasource should be in disabled state ^-- this is not true, datasource is disabled [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => false } The same with EAP 6.1.0 [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:add(connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1, jndi-name=java:jboss/datasources/Test2, driver-name=h2) {"outcome" => "success"} [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:disable() { "outcome" => "success", "response-headers" => { "operation-requires-reload" => true, "process-state" => "reload-required" } } [standalone@localhost:9999 /] reload [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => false } I'm getting same result when I add step enable after creation of datasource. EAP 6.1.0 [standalone@localhost:9999 /] data-source add --name=Test2 --driver-name=h2 --jndi-name=java:jboss/datasources/Test2 --connection-url=jdbc:h2:mem:test2;DB_CLOSE_DELAY=-1 [standalone@localhost:9999 /] data-source enable --name=Test2 [standalone@localhost:9999 /] data-source disable --name=Test2 operation-requires-reload true process-state reload-required [standalone@localhost:9999 /] reload [standalone@localhost:9999 /] /subsystem=datasources/data-source=Test2:read-attribute(name=enabled) { "outcome" => "success", "result" => false }
isn't it this bug? https://bugzilla.redhat.com/show_bug.cgi?id=952277 Should be solved and verified on ER7
This issue was verified using the 6.2.0.CR1 preview bits.