mysql - Strange error "A new entity was found through the relationship" in Symfony on production environment -


i have strange error doctrine common error:

critical: uncaught php exception doctrine\orm\orminvalidargumentexception: "a new entity found through relationship 'isc\corebundle\entity\orders#ordersproducts' not configured cascade persist operations entity: isc\corebundle\entity\ordersproducts@000000000888648200000000198a79af 

strangeless in error frequency. can handle 5000 orders programming code , working good. 5001st order generate error, , not save ordersproducts.

i googled solution, found (like doctrine - new entity found through relationship, https://groups.google.com/forum/#!topic/doctrine-user/bdy1qgm4tu4, etc) doensn`t me.

also, error occuring on production environment working lot of servers. on developer environment 1 server working good.

in logs looks (user has 1 session id):

  • www1 - visited product page
  • www1 - added product1 in cart
  • www2 - added product2 in cart
  • www7 - visited cart
  • www2 - choosed payment paypal
  • www2 - initialized order (and saved in db orderproducts)
  • www4 - send data paypal , redirect user payment
  • www3 - request paypal payment - trying update order , orderproducts - exceptions generated here

does got before similar problem doctrina? due using few servers?

programming code "good" orders , "bad" identical

p.s. php5.4; symfony2; mysql

if error occur on production server , not on others, think have different version of mysql on production server.

if have same mysql version on each server, try composer update on production server, , then, on development servers.

but, must resolve problem. error said new entity found through order#ordersproduct .

to solve error, have 2 solutions :

1) - persist new entity in action using : $em->persist($thecreatedentity)

2) - add cascade={"persist"} in mapping of entity (child or parent, don't know relation using).

this should solve problem element n°5001, , prevent error 5000 previous elements.

see doctrine - working associations


Comments

Popular posts from this blog

html - Firefox flex bug applied to buttons? -

html - Missing border-right in select on Firefox -

c# - two queries in same method -