You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a problem with entityManager when flushing multiple entities,
try {
$products = $this->getProducts();
$this->processUpdateProducts($products);
} catch (EntityManagerClosed $e) {
$this->managerRegistry->resetManager();
$this->entityManager = $this->managerRegistry->getManager();
$products = $this->getProducts();
$this->processUpdateProducts($products);
}
I load more than 200 products and have a batch flush max of 50 at once. in some scenarios entityManager is closed, I load again those products that are not executing and then update products,
then it throw ORMInvalidArgumentException (Multiple non-persistance entities) because of in unitOfWork method doPersist and line no 2054
$entityState = $this->getEntityState($entity, self::STATE_NEW);
is always return 2 which is incorrect I want to update not insert,
The text was updated successfully, but these errors were encountered:
I have a problem with entityManager when flushing multiple entities,
try {
$products = $this->getProducts();
$this->processUpdateProducts($products);
} catch (EntityManagerClosed $e) {
$this->managerRegistry->resetManager();
$this->entityManager = $this->managerRegistry->getManager();
$products = $this->getProducts();
$this->processUpdateProducts($products);
}
I load more than 200 products and have a batch flush max of 50 at once. in some scenarios entityManager is closed, I load again those products that are not executing and then update products,
then it throw ORMInvalidArgumentException (Multiple non-persistance entities) because of in unitOfWork method doPersist and line no 2054
$entityState = $this->getEntityState($entity, self::STATE_NEW);
is always return 2 which is incorrect I want to update not insert,
The text was updated successfully, but these errors were encountered: