title: mysql foreign key update constraint in a transaction?
body: <p>I can not find official mysql explanation about this, so I wanna throw it here.
  If I have foreign key constrains between two tables in MySQL, say tableA is the parent table, tableB is the child table. And, on parent tableA, I will use "ON UPDATE CASCADE ON DELETE CASCADE" to make sure actions of update/delete can be applied to child tableB by MySQL automatically.</p>
  
  <p>Now, my question is: if the update to child table and parent table is in a transaction or not?
  Or by using the following statements, any differences?</p>
  
  <p>Method 1:
  UPDATE tableA SET col1="A" and col2="B";</p>
  
  <p>Method 2:
  Begin;
  UPDATE tableA SET col1="A" and col2="B";
  Commit;</p>
  
  <p>Now, I met the problems in method1: when tableA is updated, tableB might take very long to update its corresponding columns(not in a transaction for sure). 
  Anyone met similar problems before?</p>