protected function flushTransaction($object = null)
    {
        $violations = new ConstraintViolationList();

        try {
            $this->om->flush();

            if (null !== $this->connection && null === $object) {
                $this->connection->commit();
            }
        } catch (\Exception $e) {
            $this->flushTransactionException($e, $violations, $object);
        }

        return $violations;
    }