Appears to be working just fine with Laravel 5.4 and MySQL 5.5 (InnoDB). Maybe delete the record in the DB and run this again just to make sure the record wasn't there from previous tests? Unless it's related to MySQL 5.6.
Aug 25, 2017
2
Level 3
DB Transaction not rolling back in simple test
I'm wondering what I'm doing wrong here. I'm just trying what I think is a very basic transaction test because I noticed records not rolling back in the more complex transaction. Same result using closure method.
$model = new MyEloquentModel();
$model->prop = "value";
DB::beginTransaction();
$model->save();
DB::rollBack();
dd("finished");
Check my database and the MyEloquentModel() record is there. Using Laravel 5.4 with MySQL 5.6 - InnoDB tables.
Please or to participate in this conversation.