Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  What is the correct way to close a MboSet?

    Posted Tue December 12, 2023 06:41 AM

    Hi,

    i am wondering what is the correct way to close a MboSet that is opened via MXServer.

    In the last time i always used something like this:

    mboSet = MXServer.getMXServer().getMboSet("SOMETHING",userInfo)
    mboSet.close()
    mboSet.cleanup()

    The IBM Autoscript Documentation only says cleanup (in the example) -> Scripting best practices

    A colleague of mine said he uses clear/close:

    mboSet = MXServer.getMXServer().getMboSet("SOMETHING",userInfo)
    mboSet.clear()
    mboSet.close()

    Can anyone explain the differences between clear, close and cleanup? What is the best way/combination to close a mboSet and remove it from memory?



    ------------------------------
    Andreas Brieke
    IT Service Management Consultant
    SVA System Vertrieb Alexander GmbH
    ------------------------------


  • 2.  RE: What is the correct way to close a MboSet?

    Posted Tue December 12, 2023 09:25 AM

    Hi Andreas,

    In my opinion differences between methods close and cleanup were described in really good way in this article: Closing MboSets

    I also found blog post done by Bruno Portaluri: MBO Performance Tip N.6 – Free resources as soon as possible



    ------------------------------
    Bartosz Marchewka
    IBM Maximo Consultant
    AFRY
    ------------------------------



  • 3.  RE: What is the correct way to close a MboSet?

    Posted Tue January 21, 2025 07:49 AM

    Hi,

    I was also in a small discussion.

    Is a mboSet.save() the equal of mboSet.close()?
    In other words. Does a .save() also close the set?

    Regards,

    Vincent Wanders



    ------------------------------
    Vincent Wanders
    ------------------------------



  • 4.  RE: What is the correct way to close a MboSet?

    Posted Tue January 21, 2025 11:00 AM

    I wrote a post on this a while back in case it is useful.

    https://www.sharptree.io/blog/2021/2021-11-22-close-things/

    Jason



    ------------------------------
    Jason VenHuizen
    Sharptree
    https://sharptree.io
    https://opqo.io
    ------------------------------



  • 5.  RE: What is the correct way to close a MboSet?

    Posted Wed January 22, 2025 06:59 AM

    Hi Jason,

    Thank you for your reply.

    I did read the blog, but I did not find the answer of my question.
    If the .save() closes the set the correct way as a .close() would do.  (and the .close() is not needed then.)

    However I learned something with your blog.
    cleanup I never used. Didn't even know about this statement.

    Vincent



    ------------------------------
    Vincent Wanders
    ------------------------------



  • 6.  RE: What is the correct way to close a MboSet?

    Posted Wed January 22, 2025 10:19 AM

    Saving the MboSet frees the database connection but does not close or cleanup, so I think the answer to your question is that .save() is not sufficient.  You still need to call .close() after calling .save().



    ------------------------------
    Jason VenHuizen
    Sharptree
    https://sharptree.io
    https://opqo.io
    ------------------------------