Bug 1005131 - read-resource() call returns Incorrect 'udefined' result for datasources
read-resource() call returns Incorrect 'udefined' result for datasources
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Domain Management (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: ---
: EAP 6.2.0
Assigned To: Brian Stansberry
Petr Kremensky
Russell Dickenson
Depends On:
  Show dependency treegraph
Reported: 2013-09-06 05:31 EDT by Ondrej Chaloupka
Modified: 2013-12-15 07:28 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-06 09:05:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Ondrej Chaloupka 2013-09-06 05:31:57 EDT
In case that you call in jboss-cli read-resource() on datasource subsystem you will get datasource as undefined:
    "outcome" => "success",
    "result" => {
        "xa-data-source" => undefined,
        "data-source" => {"ExampleDS" => undefined},
        "jdbc-driver" => {"h2" => undefined}

This makes problem in case of using DMR api and commands. When you call the same command in your app and you want to check existence of the data source in this way:
you will get "false". But the datasource exists and it's quite nicely defined.
Command should return true.

The isDefined() starts to work when the command is called with recursive=true.

As sort of reproducer could be used my testing class
Comment 1 Alexey Loubyansky 2013-09-06 06:07:49 EDT
This is not going to change. ModelNode.isDefined() has a different meaning. You are supposed to use recursive=true.

BTW, in case of data-source's, if there is data-source=XXX, it means XXX is actually there. The management won't allow XXX to be undefined.
Comment 2 Ondrej Chaloupka 2013-09-06 06:25:14 EDT
Hi Alex,

ok, I see. Just it isn't much intuitive. I would expect that isDefined() returns true in any case that a node is 'somelike' defined.

I understand that I can visually see that data-source=XXX is defined in cli. But when I want to check this in code then I can't check anything visually.

In case that it's supposed behavior and you think that it's ok for users then please close this bugzilla.


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