when a row is going to be updated, whether this action will affect the row can be hard to predicted, so I want the db to callback some api service when the action is done correctly and also, when the api is not called correctly, the updated action need to going back to previous version.
So , I want to do it in db level. I research a bit and know some oracle db have this calling java-function feature and postgreSQL only have a deprecated project related to it and maybe unreliable.
Also, how can I do it in java to achieve this kind of consistency between db and api service(such set a value to redis, this would fail if redis is unable to connect, so calling this api is thought to be failed)