简体   繁体   中英

Doctrine 2 ODM - saving nested embedded documents works in development environment but not in the production environment

if have a record that looks something like this:

{
    'title'    :'test',
    'subdoc'   :[{
        'title'    : 'sub test',
        'subdoc2'  : [{
            'title'    : 'sub 2 test';
        }]
    }]
}

I have the corresponding entities set up for doctrine, where subdoc is an EmbedMany of the root document and subdoc2 is an EmbedMany of subdoc.

It works great in my development environment. In the production environment, it dosn't save the subdoc2. I can create it, add it to the subdoc, and tell it to flush, no errors, but it just simply doesn't save.

Things I've ruled out:

  • It's not doctrine: both environments are using the same version of doctrine, exact same files
  • It's not mongo: same version of mongo php driver: 1.2.2 (same configuration)
  • both using apache2 on ubuntu
  • It can't be my code, could it? I mean the same code is on both machines

Things it could be:

  • Production: PHP Version 5.3.5-1ubuntu7.2; Dev: PHP Version 5.3.5
  • Production is actually Zend Server, development is not. I don't really have control over that, but maybe there are some settings in Zend Server that might be causing problems? I'de be happy to post specific settings, but there are a lot of them so I don't want to post them all unless they are needed.

I'm really at loss! Please help.

As it turns out, the version of mongodb server where different. Followed directions here and now it works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM