Nested database transactions in Postgresql 14 and Laravel 9

13 views Asked by At

I would like to know what happened if my Laravel 9 code with standard database settings contains nested transactions. So I have a code which open parent transaction and then open child transaction inside the parent one. Then I make commit in child transaction and continue. Then I want to make rollback in parent transaction. Does this rollback also rollback the child transaction? ChatGPT say something about savepoints but I dont trust him much. Can somebod tell me please what will happen and how to rollback the child transaction with the parent one?

0

There are 0 answers