[wildfly-dev] WFLY-3512 - disable datasource undeploy application

Brian Stansberry brian.stansberry at redhat.com
Fri Nov 14 18:30:48 EST 2014


On 11/14/14, 10:24 AM, Claudio Miranda wrote:
> The behavior I could see, when user disables the datasource,
> - the application is disabled,
> - then the datasource is disabled,
> - there is an error (DataSourceStatisticsListener at 53450cac" failed:
> java.lang.IllegalArgumentException: WFLYCTL0218: A node is already
> registered at '(subsystem => datasources)(data-source =>
> ExampleDS)(statistics => jdbc)')
> - the datasource is enabled
> - then the application is enabled
>
> Is this the expected behavior ?

The error is not expected. Everything else is.

The re-enabling of the ds and app is a result of the server 
automatically rolling back the operation when the server detects that 
the operation has introduced a missing service dependency. I believe the 
error is a problem occurring during rollback.

> User must be aware that disabling a datasource will put the
> application in disabled status.
>

If the user does not include the allow-resource-service-restart=true 
operation header, the operation should simply change the config, put the 
server into reload-required state and not affect the runtime datasource 
service or the application.

If in addition to allow-resource-service-restart=true the user also 
includes operation header rollback-on-runtime-failure=false, then the 
datasource and the application should remain disabled in the runtime.

If you then execute the "enable" op on the ds, the application should 
come back up.

If you restart/reload the server before enabling the ds, you'll get boot 
failures due to the app needing the unavailable ds.

[1] 
https://docs.jboss.org/author/display/WFLY9/Admin+Guide#AdminGuide-OperationHeaders

> On 10/27/14, 11:27:55 AM, Brian Stansberry wrote:
>> The datasource subsystem shouldn't need to know that kind of
>> information. When the operation rolls back it should restore the
>> services it removed, and MSC will take care of bringing back up whatever
>> services were stopped when the DS services were removed.
>>
>> This needs fixing:
>>
>> https://github.com/wildfly/wildfly/blob/master/connector/src/main/java/org/jboss/as/connector/subsystems/datasources/AbstractDataSourceRemove.java#L111
>>
>> On 10/25/14, 7:33 AM, Claudio Miranda wrote:
>>> Hi, related to WFLY-3512, disable a datasource used by some
>>> application, undeploy the application, tested in 8.1 and 9.0 snapshot.
>>>
>>> I saw that org.jboss.as.connector.subsystems.datasources.DataSourceDisable
>>> (connector module) is called, but there is no previous check about
>>> deployments that uses it.
>>> How can datasource subsystem get to know the deployment dependencies
>>> for resources (datasource and resource adapter) ?
>>> Is there a listener mechanism where datasource subsystem can listen to
>>> deploy enablement, and check the resources dependencies ? This way,
>>> datasource subsystem can have a lista of dependency and check it
>>> before disable/remove of datasources.
>>>
>>> 1. https://issues.jboss.org/browse/WFLY-3512
>
>
>
>
>


-- 
Brian Stansberry
Senior Principal Software Engineer
JBoss by Red Hat


More information about the wildfly-dev mailing list