Model save() do not work with Autocommit disabled

I use PDO::ATTR_AUTOCOMMIT => 0 in my bootstrap.

I'm trying to update a record. I'm doing something like this:

$thing = Thing::findFirst( $id );
$thing->someProperty = 'some another value';
$result = $thing->save();

When I try to save a model instance, it returns true, with no error messages in the $thing->getMessages(). If I enable Autocommit, it works well. But with autocommit disabled, it does not save, even if I add an implicit transaction.

Why doesn't this call return an error and how can I find out what is blocking transaction commit?


I think you need use assign function for update

$thing = Thing::findFirst( $id ); $thing->assign(array( 'someProperty' => 'some another value' )); $result = $thing->save();