Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

MySQL sequential procedure call with transactions

How do transactions within stored procedures affect each other? Is it possible to use this structure or will the second procedure interrupt the transaction of the first one?

CREATE PROCEDURE some_procedure() begin
    ...
    CALL some_procedure1();
    CALL some_procedure2();
    ...
end
CREATE PROCEDURE some_procedure1() begin
    START TRANSACTION;
    ...
    COMMIT;
end
CREATE PROCEDURE some_procedure2() begin
    START TRANSACTION;
    ...
    COMMIT;
end

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

There’s only one thread for a given MySQL session, so the procedures run serially.

some_procedure1() commits its transaction before it returns, and that must finish before some_procedure2() is called.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading