7

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, ...)

Community
  • 1
  • 1
Bruno
  • 1,088
  • 1
  • 13
  • 31
  • 4
    See http://stackoverflow.com/questions/1306869/are-nested-transactions-allowed-in-mysql – Mattias Lindberg Oct 08 '15 at 07:57
  • I found this ressource, a similar subject is approached, but it don't speak about the actual nesting of START TRANSACTION wich can occur in source code. I found an article on wikipedia saying that mysql do not support the nesting, but in this coase how does he behave? I found nowhere an answer – Bruno Oct 08 '15 at 08:33

1 Answers1

16

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.

fancyPants
  • 50,732
  • 33
  • 89
  • 96