Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how mysql handle multiple START TRANSACTION (nesting?) [duplicate]

I can't find the answer : how MySQL handle when in the same connection I call multiple time START TRANSACTION

for example does the autocommit the current one in order to start a fresh new or does he nest them?

NB : this is not a duplicate of Are nested transactions allowed in MySQL? because I don't whant to know if mysql allow it, or how to simulate this behaviou. I found that mysql does not nest the transactions and I want to know how MySQL actually handle nested START TRANSACTION (by commiting the old one, by ignoring the new start transaction, ...)

like image 989
Bruno Avatar asked Oct 08 '15 07:10

Bruno


1 Answers

Read the manual instead of wikipedia.

First entry from googling "mysql start transaction":

13.3.1 START TRANSACTION, COMMIT, and ROLLBACK Syntax

Beginning a transaction causes any pending transaction to be committed. See Section 13.3.3, “Statements That Cause an Implicit Commit”, for more information.

like image 168
fancyPants Avatar answered Oct 04 '22 21:10

fancyPants