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]
Ivo Studensky <istudens> made a comment on jira WFLY-1933 My PR can be found here: https://github.com/istudens/wildfly/compare/WFLY-1933
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
Ivo Studensky <istudens> made a comment on jira WFLY-1933 Oh, no. There is another jira WFLY-1893 for this..
Jesper Pedersen <jpederse> made a comment on jira WFLY-1933 For now, I'll let you close this as a duplicate yourself
Ivo Studensky <istudens> made a comment on jira WFLY-1933 This duplicates WFLY-1893.
Verified with EAP 6.2.0.ER7
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.
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.