Original Message:
Sent: Wed January 07, 2026 04:17 AM
From: Andrzej Więcław
Subject: The rules about when to close an MboSet are a bit confusing.
Hi Osama,
in most of the cases the rule is actually simple and can be phrased this way:
You should always close and cleanup MboSet (ref. e.g. Closing MboSets) which hasn't been opened via any of the psd.mbo.Mbo#getMboSet(...) calls, otherwise you need to close the set.
Why did I say in most of the cases? Because it's all about sharing an instance of MXTransaction which is happening automatically whenever you call any of the overridden psd.mbo.Mbo#getMboSet(...)methods.
Technically you can still open new MboSet using psdi.server.MXServer#getMboSet(...) or psdi.server.AppService#getMboSet(...) and do the following:
newMboSet.setMXTransaction(otherMboSet.getMXTransaction());
In such case, if otherMboSet is managed by Maximo (UI, escalation, etc.) then you should skip closing the MboSet explicitly and in general - calling MboSet lifecycle methods (e.g. MboSet#save()).
Regarding psdi.mbo.Mbo#getThisMboSet() usage. The key here is to realize that you are NOT opening new MboSet but only acquiring a reference to already existing one, hence all the rules described above apply.
Regarding usage of psdi.mbo.Mbo#moveNext()(and others psdi.mbo.Mbo#moveNext(), psdi.mbo.Mbo#movePrev(), psdi.mbo.Mbo#moveLast(), psdi.mbo.Mbo#moveTo()) in combination with any of psd.mbo.Mbo#getMboSet(...) - in general there is no such rule but I would say it's a good "just in case" practice, just to avoid glitches e.g. with the UI. Namely all these methods are changing current MBO index reference. Depending on your customization logic injection point it may interfere/affect other logic which may depend on the MBO index (like UI).
------------------------------
If this post helps, please consider accepting it as a solution to help other members find it more quickly.
Andrzej Więcław
Maximo Technical SME
ZNAPZ B.V. (part of Naviam)
Wrocław, Poland
Original Message:
Sent: Tue January 06, 2026 07:42 AM
From: osama attia
Subject: The rules about when to close an MboSet are a bit confusing.
The rules about when to close an MboSet are a bit confusing.
sources I've read agrees that you should definitely close the MboSet obtained from:
MXServer.getMXServer().getMboSet(...)
service.getMboSet("MBOSET", MXServer.getMXServer().getSystemUserInfo())
However, you should not close your current MboSet obtained from mbo.getThisMboSet().
Where it gets confusing is when using mbo.getMboSet("Relationship"). Some blogs suggest closing the MboSet retrieved this way, while I was under the impression that it should not be closed, because Maximo closes it automatically along with the main Mbo.
Additionally, what about mbo.getMboSet("$tempRelation", "MboSet", "Query")?
I've also read that you should not use moveNext() with mbo.getMboSet("Relationship"). Is that true?
#Maximo #Maximo #MaximoEAM #IBMMaximo #IBMMaximoAssetManagement
------------------------------
osama attia
------------------------------