Looks like cache corruption: try switching to a different cache adapter and
see if the error still occurs.

Marco Pivetta

http://twitter.com/Ocramius

http://ocramius.github.com/

On 17 December 2014 at 20:48, Sebastian Choren <[email protected]>
wrote:
>
> Hello,
>
> I'm using Doctrine v2.4.6 (with Symphony, if that matters) for a kind of
> complex project. The issue I'm having is when running an importer (that
> handles up to 200k rows per file, multiple files). My entities are
> something like this:
>
> Person
> - id
> - name
>
> Address
> - idaddress
> - person (many-to-one Person)
> - type (many-to-one Type)
> - Address
>
> Phone
> - idphone
> - person (many-to-one Person)
> - type (many-to-one Type)
> - phone
>
> Type
> - idtype
> - description
>
> (Entities are mapped with XML)
>
> So, the importer process reads one file at a time (each file contains one
> kind of entity, like Person.csv, Address.csv, etc) and creates entities,
> that are then stored in APCCache. So far there's no access to DB.
> The second step is to process those entities in the right order (first
> Person, then Address, then Phone, etc). In this process, I check the DB to
> see if it's an update or an insert. After that, I check that all relations
> are contained by the EntityManager (since they were cached in APC,
> relations such as Type might get detached and Doctrine tries to insert
> them). Then I persist the object, and finally I flush the object, i.e.
> $om->flush($object).
>
> 99% of the time this works, but with random Phones it throws this error:
> Notice: Undefined index: id in
> Doctrine/ORM/Persisters/BasicEntityPersister.php line 685.
>
> The error rises when Doctrine tries to find the association info for the
> object Person. Digging in the UnitOfWork, I noticed that the contents of
> $uow->entityIdentifiers[spl_object_hash($person)] contains the association
> information of Type instead of Person.
>
> I really don't know what I can be doing wrong here. Specially since it
> works most of the times, and the offending Entity varies from run to run.
>
> What should I look for?
>
> Thanks!
>
> --
> 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 http://groups.google.com/group/doctrine-user.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to