Skip to content
Advertisement

Tag: doctrine

Exception ‘no active transaction’ when using ORMExecutor::execute

I upgraded a legacy project from: PHP 5.6 -> 8.0 doctrine/orm 2.5.14 -> 2.13.4 doctrine/data-fixtures 1.2.2 -> 1.5.3 Now the following code throws the exception: PDOException : There is no active transaction /var/www/html/src/vendor/doctrine/dbal/src/Driver/PDO/Connection.php:120 /var/www/html/src/vendor/doctrine/dbal/src/Connection.php:1481 /var/www/html/src/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php:280 The exception is thrown when DoctrineORMEntityManager::transactional calls: $this->conn->commit() In the documentation I read: Not all RDBMS have the capability to allow TRUNCATE statements inside transactions

How to get data from a column with this annotation @ORMindex

Good afternoon, please tell me how to get the column data: {@ORMIndex(name=”localities_names_idx”, columns={“name_ru”, “name_cn”, “name_en”}) I tried using queryBuilder : Without success I need it for: Answer Edit: This turned into a review, but might as well keep it here You’re using index wrong. I’m guessing you’re using it incorrectly. I’m assuming you want an index for faster search. However,

Symfony 5.4 Form: Issue with EntityType custom query_builder orderBy(‘rand’) and setMaxResult

I’m struggling with a ‘strange’ behavior. When I use setMaxResult() + Rand() on my query_builder. I got randomly the message that my value is not valid. SymfonyComponentValidatorConstraintViolation {#1320 ▼ -message: “Cette valeur n’est pas valide.” -messageTemplate: “This value is not valid.” -parameters: [▶] -plural: null -root: SymfonyComponentFormForm {#911 ▶} -propertyPath: “children[press]” -invalidValue: “8” -constraint: SymfonyComponentFormExtensionValidatorConstraintsForm {#987 …} -code: “1dafa156-89e1-4736-b832-419c2e501fca” -cause:

Advertisement