I want to find out, if there is an illegal commit in my Oracle PL/SQL code, perhaps nested deeply. Thus, I executed "alter session disable commit in procedure". With this, an error will be raised if that happens.
But.. It can be that there are savepoints defined in the code, and perhaps it is rolled back to these. This is ok, because that will not create inconsistent data.
Unfortunately, Oracle seems not to allow any transaction control statements when "disable commit in procedure" is set.
So, I am looking for a way to forbid commits in the code, but allow useful transaction control.
What do you call an "illegal commit"?
Perhaps you'd want to query
user_sourceand see which parts of code contain any reference tocommit, review them and do something:Something like this: