That would be the first place to look, i think. If the error really is due to committing inside a cursor then there is no amount of UNDO tweaking that will help.