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.
Labels: advanced, java, mbo, performance, tips