Doctrine2:多进程中的实体可见性

Doctrine2:多进程中的实体可见性,doctrine,doctrine-orm,doctrine-odm,doctrine-query,Doctrine,Doctrine Orm,Doctrine Odm,Doctrine Query,以下是Web上的example.php: ... $page = new SomeEntity(); $page->setName("xx"); // name is primary key $em->persist($page); .... 问题:当example2.php询问时,会发生什么情况: $result = $em->find('SomeEntity', 'xx'); ??null或object$page 我假设example.php仍在运行,并且还没有调用$

以下是Web上的example.php:

...
$page = new SomeEntity();
$page->setName("xx");  // name is primary key
$em->persist($page);
....
问题:当example2.php询问时,会发生什么情况:

$result = $em->find('SomeEntity', 'xx');
??null或object$page

我假设example.php仍在运行,并且还没有调用$em->flush()

编辑:

也许这也是我如何称呼$em的决定性因素:

$em = \Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('doctrine');

在未执行任何刷新操作之前,数据不会持久化。因此,数据不会与其他进程共享

您的
$result
变量将为
null