Transaction Safe (Silly Mistake TIP)


#1

Hi,

After 2 hours of fighting with Atk/MySQl/PDO and almost all DB classes in atk I found Why my Database Was not Rolling Back. And found a silly mistake. Pasting here as Tip for others to look for such mistake if your database is not rolling back.

  1. Engine should be InnoDB (Done… it was ok)

and my mistake :smile:
2. IF your transaction contains any CREATE / ALTER … (DDL) queries mysql will not rollback your queries and in our ERP system a single model was using

$this->add('dynamic_model/Controller_AutoCreator'); 

And … oops… rollback not working …

So please check for any such mistake if your transactions are not working properly.


#2

that’s why it’s an add-on :wink:

Is ALTER being executed on every request?