title: Let MySQL AFTER INSERT trigger fire after transaction finishes
body: <p>I have a mysql database, where entries are added in two related tables within an explicit transaction block. When the transaction finishes successfully (and only then), another process should be notified, about the new data.</p>
  
  <p>To achieve this, I wrote a UDF, that notifies the other process via IPC. I also set up an AFTER INSERT trigger on one of the tables and the trigger calls the UDF.</p>
  
  <p>I assumed, that the trigger will fire after the transaction finishes and the rows are actually inserted. However, it seems, it is executed immediately, after the INSERT statement was executed.</p>
  
  <p>Is there some way to delay the execution of the trigger function until the rows are really actually globally inserted in the db (i.e. after the COMMIT)?</p>
  
  <p>I guess, a workaround would be, to explicitly call the UDF after the COMMIT, but an automated approach would be much nicer.</p>