Bug 952277 - disable xa-data-source causes that data-source loses its attribute enabled set to false and after reload it becomes enabled
Summary: disable xa-data-source causes that data-source loses its attribute enabled se...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ER2
: EAP 6.2.0
Assignee: Stefano Maestri
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-15 14:39 UTC by Radim Hatlapatka
Modified: 2018-12-06 15:02 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
When an XA data source was set to `disabled`, and the data source was already `disabled`, the data source was enabled on the next restart. The cause of this issue has now been resolved. In the same circumstances, the data source now remains `disabled`.
Clone Of:
Environment:
Last Closed: 2013-12-15 16:12:52 UTC
Type: Bug
Embargoed:
smaestri: needinfo+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker WFLY-1893 0 Major Resolved Restarting server with a disabled DS enables the DS 2016-04-28 11:24:56 UTC
Red Hat Issue Tracker WFLY-1933 0 Major Closed Disabled data-source without explicit enabled="false" in configuration xml file is re-enabled again after server reload 2016-04-28 11:24:56 UTC

Description Radim Hatlapatka 2013-04-15 14:39:59 UTC
Description of problem:
I have disabled data-source (it even contained attribute enabled="false") and now I am also disabling some xa-data-source. It causes that data-source loses its attribute and with next server reload it becomes available

Version-Release number of selected component (if applicable):
6.1.0.ER4 (also in older builds but till now I had problem to find the cause of the (duplicate resource exception issue) in order to make it reproducible)

How reproducible:
always

Steps to Reproduce:
1. start server and connect via CLI
2. create some data-source (e.g. /subsystem=datasources/data-source=rhqDS:add(driver-name=h2, jndi-name=java:jboss/datasources/rhqDS, connection-url=jdbc:h2:mem:test3) )
3. create some xa-data-source (e.g. /subsystem=datasources/xa-data-source=rhqXADS:add(driver-name=h2, jndi-name=java:jboss/datasources/rhqXADS, xa-datasource-class=org.h2.jdbcx.JdbcDataSource) )
  - don't forget to add valid connection setting (e.g. /subsystem=datasources/xa-data-source=rhqXADS/xa-datasource-properties=URL:add(jdbc:h2:mem:test2) )
4. reload server and disable the data-source (rhqDS in our case)
5. see in the xml file that enabled is set to false for the data-source
6. reload server and disable xa-data-source (see, that the enabled="false" is no longer in the xml file)
7. reload server and see that data-source is enabled again, which causes duplicate resource exception when trying to enable it after that


  
Actual results:
data-source is enabled even though the last operation done on the datasource was disable which was successful

Expected results:
data-source remains disabled even after disabling xa-data-source with server reload

Additional info:
In the end the issue user gets is [1] even though he disabled it with some intermezzo operations with different xa-data-source

[1]
08:40:35,762 ERROR [org.jboss.as.controller.management-operation] (HttpManagementService-threads - 1) JBAS014612: Operation ("enable") failed - address: ([
    {"subsystem" => "datasources"},
    {"data-source" => "rhqDS"}
]): org.jboss.msc.service.DuplicateServiceException: Service jboss.data-source-config.rhqDS is already registered
	at org.jboss.msc.service.ServiceRegistrationImpl.setInstance(ServiceRegistrationImpl.java:154) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl.startInstallation(ServiceControllerImpl.java:227) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceContainerImpl.install(ServiceContainerImpl.java:561) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceTargetImpl.install(ServiceTargetImpl.java:201) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$ChildServiceTarget.install(ServiceControllerImpl.java:2228) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.msc.service.ServiceBuilderImpl.install(ServiceBuilderImpl.java:307) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
	at org.jboss.as.controller.OperationContextImpl$ContextServiceBuilder.install(OperationContextImpl.java:989) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.connector.subsystems.datasources.DataSourceEnable.addServices(DataSourceEnable.java:199)
	at org.jboss.as.connector.subsystems.datasources.DataSourceEnable$1.execute(DataSourceEnable.java:95)
	at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:440) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:322) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:229) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:224) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:194) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:115) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.controller.ModelControllerImpl$3.execute(ModelControllerImpl.java:398) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.controller.ModelControllerImpl$3.execute(ModelControllerImpl.java:388) [jboss-as-controller-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.domain.http.server.DomainApiHandler.processRequest(DomainApiHandler.java:320) [jboss-as-domain-http-interface-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.domain.http.server.DomainApiHandler.doHandle(DomainApiHandler.java:226) [jboss-as-domain-http-interface-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.domain.http.server.DomainApiHandler.handle(DomainApiHandler.java:233) [jboss-as-domain-http-interface-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.domain.http.server.security.SubjectAssociationHandler.handle(SubjectAssociationHandler.java:51) [jboss-as-domain-http-interface-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
	at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:69)
	at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
	at org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:710)
	at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)
	at org.jboss.as.domain.http.server.RealmReadinessFilter.doFilter(RealmReadinessFilter.java:47) [jboss-as-domain-http-interface-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.as.domain.http.server.DmrFailureReadinessFilter.doFilter(DmrFailureReadinessFilter.java:45) [jboss-as-domain-http-interface-7.2.0.Final-redhat-4.jar:7.2.0.Final-redhat-4]
	at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)
	at org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_09-icedtea]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_09-icedtea]
	at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_09-icedtea]
	at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final-redhat-1.jar:2.1.0.Final-redhat-1]

Comment 2 JBoss JIRA Server 2013-08-23 10:14:45 UTC
Ivo Studensky <istudens> made a comment on jira WFLY-1933

My PR can be found here:
https://github.com/istudens/wildfly/compare/WFLY-1933

Comment 3 JBoss JIRA Server 2013-08-23 10:42:42 UTC
Ivo Studensky <istudens> made a comment on jira WFLY-1933

The semantics under the {{PERSISTENT}} attribute of the {{enable}} operation should be reviewed again as it seems to be almost useless. The enable operation seems to be always called with {{persistent=true}}, see [1] [2]. Moreover, the result of the enable operation is always persisted despite the value of {{PERSISTENT}} attribute, see [3].

[1] https://github.com/wildfly/wildfly/blob/master/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DsParser.java#L263

[2] https://github.com/wildfly/wildfly/blob/master/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/Constants.java#L599

[3] https://github.com/wildfly/wildfly/blob/master/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/DataSourceEnable.java#L86

Comment 4 JBoss JIRA Server 2013-08-23 10:54:35 UTC
Ivo Studensky <istudens> made a comment on jira WFLY-1933

Oh, no. There is another jira WFLY-1893 for this..

Comment 5 JBoss JIRA Server 2013-08-23 11:45:22 UTC
Jesper Pedersen <jpederse> made a comment on jira WFLY-1933

For now, I'll let you close this as a duplicate yourself

Comment 6 JBoss JIRA Server 2013-08-26 10:29:43 UTC
Ivo Studensky <istudens> made a comment on jira WFLY-1933

This duplicates WFLY-1893.

Comment 13 Radim Hatlapatka 2013-11-04 10:42:12 UTC
Verified with EAP 6.2.0.ER7

Comment 14 Russell Dickenson 2013-11-08 04:07:01 UTC
Attention: Stefano Maestri

Can you please provide brief text appropriate to the Release Notes regarding this issue? I have looked over the code changes briefly but I cannot understand just how this issue was resolved.

Comment 15 Stefano Maestri 2013-11-08 08:13:40 UTC
Attention: Russel Dickenson

Release note text: enabled attribute is correctly marshaled on xml when :disable operation is used.


Let me know if you need something else.


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