Hello,

I have a problem with ManyToOne relation.

For example, I have main object with three child and when I execute on main 
object

                            $em = $this->getDoctrine()->getManager();

                            $em->merge($data);

                            $em->flush();

I sometimes get ERROR message like:

*Uncaught PHP Exception 
Doctrine\DBAL\Exception\UniqueConstraintViolationException: "An exception 
occurred while executing 'UPDATE*

 

I get this ERRROR message not for all main object and not for all child. 
For example, first update child object is ok but in second I get Error.

 

SQL prepared by doctrine: 

UPDATE child_table SET id = ?, name = ?, object_name = ?, object_size = ? 
WHERE id = ?' with params ["2", "test Name object 2", "test name object 2", 
"1234", 3]

 

In this sql the doctrine tries update object with id=3 using data from 
object with id = 2.

 

I am using 10.4 PostgreSQL.


-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to