I'm getting this error when i try to save to my db an employee.

> Fatal error: Uncaught exception 'Exception' with message 'User Error:
> Some trans actions have not been committed or rolled back in
> C:\wamp64\www\magento1\vendor\
> magento\framework\DB\Adapter\Pdo\Mysql.php on line 3774' in
> C:\wamp64\www\magent
> o1\vendor\magento\framework\App\ErrorHandler.php:61 Stack trace:
> #0 [internal function]: Magento\Framework\App\ErrorHandler->handler(256, 'Some t
> ransactio...', 'C:\\wamp64\\www\\m...', 3774, Array)
> #1 C:\wamp64\www\magento1\vendor\magento\framework\DB\Adapter\Pdo\Mysql.php(3774
> ): trigger_error('Some transactio...', 256)
> #2 [internal function]: Magento\Framework\DB\Adapter\Pdo\Mysql->__destruct()
> #3 {main}   thrown in C:\wamp64\www\magento1\vendor\magento\framework\App\ErrorHandler.php 
> on line 61

Here is the code

public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) {

        $salesDepartment = $this->departmentFactory->create();

        $employee = $this->employeeFactory->create();
            ->setNote('Example note!')


The sales department has been saved to database though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.