Doctrine2: entity visibility in multi processes
-
03-07-2021 - |
Domanda
Here is an example.php on the Web:
...
$page = new SomeEntity();
$page->setName("xx"); // name is primary key
$em->persist($page);
....
Question: what would happen, when example2.php asks:
$result = $em->find('SomeEntity', 'xx');
? null or object $page?
I'm assuming example.php is still running and didn't call $em->flush() yet.
Edit:
Maybe it's also decisive how I call $em:
$em = \Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('doctrine');
Soluzione
Until no flush operation has been performed, data is not persisted. Therefore, data is not shared with other processes.
Your $result
variable will be null
.
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow