View Only
Expand all | Collapse all

Mboset clear first or close?

  • 1.  Mboset clear first or close?

    Posted Tue December 05, 2023 12:14 PM


    When we get an mboset from MXServer, should we clear the mboset first and then close OR close the mboset first and then clear?



    Suhas Joshi
    Pune MH

  • 2.  RE: Mboset clear first or close?

    Posted Tue December 05, 2023 01:02 PM

    Hi Suhas Joshi,

    I found this interesting blog post Closing MboSets with explanation (first cleanup and then close):

    "When working with MboSet references that are not provided implicitly by the Automation Script framework, it is very important to clean up and close references.

    In addition, MboSets that are obtained using the System user live forever and are never automatically cleaned up because the session never terminates. For this reason and because of other security concerns, using the System user to get a MboSet should be avoided if possible.

    Finally, to make sure cleanup() and close() are always called, wrap the MboSet accessing code in a try finally statement so that even if an unexpected error occurs, your MboSet references will be properly cleaned up and closed."

    If you are using MboSet only for read-only purpose (not to saved) please read this performance tip: Use discardable MBOs when possible

    Bartosz Marchewka
    IBM Maximo Consultant