If an MboSet is used for traversing forward only and not to be saved make it discardable by setting the DISCARDABLE flag.
The following snippet shows how to do it.
MboSetRemote mboSet = getMboSet("ASSET");
mboSet.setFlag(MboConstants.DISCARDABLE, true);
MboRemote mbo=null;
for(int i=0; (mbo=mboSet.getMbo(i))!=null; i++)
{
...
}
Using a discardable MboSet does not cache the MBOs as it fetches from the database thus minimizing JVM memory usage.
Note that discardable mbos are always read-only.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.