Unitofwork fixes #60

Merged
merged 4 commits into from Sep 5, 2011

Projects

None yet

4 participants

Member

still having some issues running with this code. i end up getting nested transaction errors. when i disable them it seems like in my apps functional tests some nodes are not written/removed etc.

@stof stof and 1 other commented on an outdated diff Aug 31, 2011
lib/Doctrine/ODM/PHPCR/UnitOfWork.php
@@ -825,7 +824,7 @@ class UnitOfWork
if (isset($class->fieldMappings[$fieldName])) {
$type = \PHPCR\PropertyType::valueFromName($class->fieldMappings[$fieldName]['type']);
if ($class->fieldMappings[$fieldName]['multivalue']) {
- $value = $fieldValue === null ? null : $fieldValue->toArray();
+ $value = $fieldValue ?: $fieldValue->toArray();
stof
stof Aug 31, 2011 Member

it is really intended to change the behavior here ? If $fieldValue is null, it will now call toArray on it.

lsmith77
lsmith77 Aug 31, 2011 Member

err .. right

lsmith77
lsmith77 Sep 5, 2011 Member

reverted the change

@starkj starkj and 1 other commented on an outdated diff Aug 31, 2011
lib/Doctrine/ODM/PHPCR/UnitOfWork.php
@@ -238,11 +238,6 @@ class UnitOfWork
}
}
- if (count($refNodeUUIDs) > 0) {
- $session = $this->dm->getPhpcrSession();
- $refNodes = $session->getNodesByIdentifier($refNodeUUIDs);
- }
-
starkj
starkj Aug 31, 2011 Contributor

why should that be removed? it's part of the performance tuning for references:
first collect all uuids of the referenced nodes and then get all this nodes within one single call

lsmith77
lsmith77 Aug 31, 2011 Member

$refNodes is not used anywhere

starkj
starkj Aug 31, 2011 Contributor

it's just a dummy so that the nodes get cached, if they are accessed later
yes, at least it could be just:

$session->getNodesByIdentifier($refNodeUUIDs);

lsmith77
lsmith77 Sep 5, 2011 Member

reverted the change

@dbu dbu merged commit 787c012 into master Sep 5, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment