Topic
6 replies Latest Post - ‏2012-05-28T17:38:27Z by llandale
DanMott
DanMott
26 Posts
ACCEPTED ANSWER

Pinned topic accessing module attribute value without opening module

‏2012-05-23T15:18:42Z |
Since I am able to view the module-level attribute values from the module properties without opening the module, I would assume I could do the same in DXL. Anyone know how to do this in DXL?
Updated on 2012-05-28T17:38:27Z at 2012-05-28T17:38:27Z by llandale
  • llandale
    llandale
    635 Posts
    ACCEPTED ANSWER

    Re: accessing module attribute value without opening module

    ‏2012-05-24T17:41:51Z  in response to DanMott
    See the "ModuleProperties" section under chapter "Modules" in the DXL manual. You need first get a "ModuleVersion" handle on the un-opened module.

    ModuleProperties fail rudely when dealing with module-level Attr-DXL; unless that dxl is written robustly.

    -Louie
    • DanMott
      DanMott
      26 Posts
      ACCEPTED ANSWER

      Re: accessing module attribute value without opening module

      ‏2012-05-25T16:15:07Z  in response to llandale
      Thank you!! Exactly what I needed.
      • DanMott
        DanMott
        26 Posts
        ACCEPTED ANSWER

        Re: accessing module attribute value without opening module

        ‏2012-05-25T18:34:08Z  in response to DanMott
        So I've been using ModuleVersion and ModuleProperties to access the module level attribute values. However, when I ran the script across the entire database, I run into memory exhaust errors. I looked into this closer and it seems that the getProperties(mv,mp) function is the culprit, since when I uncommented that line the memory started growing during execution. I tried "delete mp" which threw a DXL error -- any clue how to clean up the memory when I'm iterating over the entire database?
        • llandale
          llandale
          635 Posts
          ACCEPTED ANSWER

          Re: accessing module attribute value without opening module

          ‏2012-05-25T19:55:58Z  in response to DanMott
          I see no such "delete(ModuleProperties)" command. But it seems unlikely you have so many modules in your database that the number of such lingering allocated units matters. Are there 10,000 modules?

          If the bottom logic produces a "string", you could do the ModuleProperties stuff inside an "eval_" string. You will get a jump in processing time, but a constant one not an exponential one.

          -Louie
          • DanMott
            DanMott
            26 Posts
            ACCEPTED ANSWER

            Re: accessing module attribute value without opening module

            ‏2012-05-25T22:13:32Z  in response to llandale
            Actually, there's more than 20,000 modules.

            Thanks for the idea on using "eval_". I was successfully able to process the entire database without an increase in memory usage. I suspect that the memory is released after the eval_ command is finished executing.

            Only minimal impact to execution time.

            Two things to note with the eval_ command... 1) you can't reference variables outside the eval_ code you are running, unless you access the memory location of the variable. For example...

            string myCode = "string modName = addr_ " ((addr_ modName) int) ""

            2) you can't update the value of an outside variable even if you access it in this manner because for basic data types it will create a new variable for a new string. Instead, you'd have to use something like an Array or Skip List so that the memory location stays constant as you update the variable.

            Thanks for your help Louie!
            • llandale
              llandale
              635 Posts
              ACCEPTED ANSWER

              Re: accessing module attribute value without opening module

              ‏2012-05-28T17:38:27Z  in response to DanMott
              I see that there are now two people in the world that grasp cheating memory within "eval_"; I'm not one of them!