As I understand autonomous transactions (in the Oracle world), the autonomous transaction ends when a commit or rollback is issued. However, I have just written a procedure as an autonomous transaction because I needed to isolate a piece of DDL that changes a tablespace from read only to read write.
Then I started thinking about when the autonomous bit ended.
The problem is that there is an implicit commit both before and after the DDL is executed. Now, I happen to know that my code has the desired effect, so I can only surmise that the initial ’empty’ commit is not the end of the autonomous transaction and the subsequent commit is. What is surprising is that I cannot find any mention of this on the internet.
Can anyone point me towards documentation that would explain my conundrum?
A routine declared autonomous is autonomous for the whole routine and doesn’t end when a commit or rollback is issued.
See here in oracle docs: