September 1, 2012

MBO Performance Tip N.6 - Free resources as soon as possible

This entry is part of the Java MBO performance optimization golden rules series.

It is important to know the difference between close(), cleanup(), and clear() methods and use them to free up resources as soon as possible.
  • close(): Close the cursor, release the database resources (result set),  SQL statement, and connection key. Does not release MBO objects. You can still work with MBOs already retrieved from the MboSet. Close the set as soon as possible if reusing the set is not needed in following logic.
  • cleanup(): Reset the MboSet, and clear its current transaction. Clears any filters.
  • clear(): Removes all the objects from the collection as well as all related objects.


  1. We are using and Escalations > communications Log -- deleting the entries and saving (especially if you have many rows e.g. 3000) will cause the highest_open_cur to go up.

    We encounter ORA-01000 errors also when we run PMWoGen crontask every week.

  2. Hi Bruno,
    Is there any guideline suggest mboSet/s can be left unclosed if all of them fetched through relationship and mxtranasction involving them gets completed it will close all of those related sets ?