How to implement autonomous transaction

The problem I’m having

I want to commit only the part of code which is called. Like there are 4 update statements made one after another as shown in code. But when I write commit; I want only 3rd one to commit and not 1st and 2nd.
Similar thing is achieved in Oracle using autonomous transaction.

The context of why I’m trying to do this

What I’ve already tried

Some example code or error messages

<update sql>
<update sql>
<update sql>
<update sql>