Bug 970679 - Cannot disable Datasource or XADatasource in standalone and domain modes
Cannot disable Datasource or XADatasource in standalone and domain modes
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA (Show other bugs)
6.1.0
Unspecified Unspecified
unspecified Severity high
: CR1
: EAP 6.2.0
Assigned To: Stefano Maestri
:
Depends On:
Blocks: 962890 970699
  Show dependency treegraph
 
Reported: 2013-06-04 10:59 EDT by Thomas Segismont
Modified: 2013-12-15 11:17 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-15 11:17:44 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2403 Major Resolved Cannot disable Datasource or XADatasource in standalone and domain modes 2015-11-30 01:53 EST

  None (edit)
Description Thomas Segismont 2013-06-04 10:59:08 EDT
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
Comment 1 Thomas Segismont 2013-06-04 11:29:49 EDT
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.
Comment 2 Thomas Segismont 2013-06-04 11:51:42 EDT
Same behavior in domain mode for XADatasource
Comment 8 John Doyle 2013-10-28 15:18:46 EDT
Stefano,

Can you get this resolved for the next EAP build cutoff?  November 8.
Comment 10 Martin Simka 2013-11-11 10:55:21 EST
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?
Comment 11 Stefano Maestri 2013-11-11 11:25:57 EST
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}
Comment 12 Brian Stansberry 2013-11-11 12:32:04 EST
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?
Comment 13 Martin Simka 2013-11-12 04:48:39 EST
@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
}
Comment 14 Stefano Maestri 2013-11-12 04:59:27 EST
isn't it this bug?

https://bugzilla.redhat.com/show_bug.cgi?id=952277

Should be solved and verified on ER7
Comment 15 Martin Simka 2013-11-12 08:58:13 EST
This issue was verified using the 6.2.0.CR1 preview bits.

Note You need to log in before you can comment on or make changes to this bug.