I have strange error with Doctrine common error:
CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMInvalidArgumentException: "A new entity was found through the relationship 'Isc\CoreBundle\Entity\Orders#ordersProducts' that was not configured to cascade persist operations for entity: Isc\CoreBundle\Entity\OrdersProducts@000000000888648200000000198a79af
Strangeless is in error frequency. We can handle 5000 orders with that programming code and everything will working good. But 5001st order will generate this error, and we will not save ordersProducts.
I googled solution, but everything I found (like Doctrine - A new entity was found through the relationship, https://groups.google.com/forum/#!topic/doctrine-user/bdY1QgM4Tu4, etc) doensn`t help me.
Also, error is occuring on production environment what working with a lot of servers. On developer environment with one server it is working good.
In logs it could looks like (user is always has one session id):
- www1 - visited product page
- www1 - added product1 in a cart
- www2 - added product2 in cart
- www7 - visited cart
- www2 - choosed payment Paypal
- www2 - initialized order (and saved it in db with orderProducts)
- www4 - send data to paypal and redirect user to payment
- www3 - get request from Paypal about payment - trying to update order and orderProducts - exceptions generated here
Does anybody got before similar problem with Doctrina? Could this be due we are using few servers?
Programming Code for "good" orders and "bad" always identical
p.s. php5.4; symfony2; mysql