I have a custom model object and want to persist it to the related database table. When I try to save the model, nothing happens. In case I do not enter required fields, I get an "Integrity constraint violation" exception. The inner message shows me, that the model is working on the right table. Saving a model did work that way in other situations before. But ofter some changes I have the described problem. Does anyone know, why the model cannot be saved and no error is thrown?


public function createModelEntry(\vendor\Module\Api\Data\MyModelInterface $modelData) { $modelData->save(); }

1 Answer 1


Ok, it seems that magento does not support multi-column primary keys on its tables. That leads to the strange behaviour that the constraint validation works when saving a model but the saving itself fails without any error message. I have modified my table so it use only one primary key column.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.