mboSet = MXServer.getMXServer().getMboSet("MYTABLE", mbo.getUserInfo()) mboSet.deleteAll() mboSet.save()
Unfortunately the table I had to purge (MYTABLE in the example) was having more than 5000 rows so when I launched the script I got the following error.
BMXAA7387E - While attempting to retrieve 5001 of MYTABLE, the operation was terminated because the preset limit 5000 was exceeded for retrieving MYTABLE into a single set. Reduce the number of selected objects for the operation.The simple solution would have been to increase the mxe.db.fetchResultStopLimit Maximo system parameter as documented in this post but I was looking for a more elegant solution.
Searching a little in the Maximo Java code i discovered the MboSet.setLogLargFetchResultDisabled() method that was exactly what I was looking for. Calling this method before the bulk operation will disable logging of large fetch result set to avoid FetchResultLogLimit errors. As a positive side effect it also increased the performances a lot.
The updated script now works like a charm.
mboSet = MXServer.getMXServer().getMboSet("MYTABLE", mbo.getUserInfo()) scSet.setWhere(where) # disable logging of large fetch result set to avoid FetchResultLogLimit errors mboSet.setLogLargFetchResultDisabled(True) mboSet.deleteAll() mboSet.save()
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.