IBM Asset & Facilities Management Your destination for peer and expert insights to help unlock the power of data with AI and Asset & Facilities Management to advance your digital reinvention. Join / Log in
When we get an mboset from MXServer, should we clear the mboset first and then close OR close the mboset first and then clear?
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