[DDC-2199] Yaml driver does not take into account field @Version attribute Created: 14/Dec/12 Updated: 16/Dec/12 Resolved: 16/Dec/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | Git Master |
| Fix Version/s: | 2.3.2 |
| Security Level: | All |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Georgy Galakhov | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | mapping, yaml | ||
| Description |
|
Even if field has version: true attribute, Yaml driver does not set class metadata isVersioned and versionField properties. As a result optimistic lock cannot be used. |
| Comments |
| Comment by Benjamin Eberlei [ 16/Dec/12 ] |
|
Fixed |
[DDC-2211] [GH-541] Fix DDC-1690 Created: 20/Dec/12 Updated: 22/Dec/12 Resolved: 22/Dec/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.2 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of PSchwisow: Url: https://github.com/doctrine/doctrine2/pull/541 Message: Added the lines suggested by the original reporter. |
| Comments |
| Comment by Benjamin Eberlei [ 22/Dec/12 ] |
|
A related Github Pull-Request [GH-541] was closed |
[DDC-2206] Setup::registerAutoloadPEAR and registerAutoloadDirectory load Symfony\Componet namespace path through pear is wrong Created: 18/Dec/12 Updated: 23/Dec/12 Resolved: 23/Dec/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | Tools |
| Affects Version/s: | 2.3.1 |
| Fix Version/s: | 2.3.2 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | auden | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Symfony\Component, pear | ||
| Environment: |
MAC,UBUNTU |
||
| Description |
|
install doctrine use pear,and the installed path is get_include_path()/Doctrine,get_include_path()/Symfony,but now Symfony\Component namespace path direct to get_include_path()/doctrine,so some file issue |
| Comments |
| Comment by Benjamin Eberlei [ 23/Dec/12 ] |
|
Fixed |
[DDC-2192] Version field not honored by XML driver Created: 09/Dec/12 Updated: 16/Dec/12 Resolved: 16/Dec/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 2.3.1 |
| Fix Version/s: | 2.3.2 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Ian Unruh | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
When specifying a version field in an XML mapping file, it is never picked up by the XML mapping driver and given to ClassMetadataInfo::setVersionMapping() |
| Comments |
| Comment by Benjamin Eberlei [ 16/Dec/12 ] |
|
Fixed |
[DDC-2175] Optimistic locking version not refreshed on update for class table inheritance Created: 28/Nov/12 Updated: 24/Dec/12 Resolved: 24/Dec/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.3 |
| Fix Version/s: | 2.3.2 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Colin Campbell | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I am trying to use optimistic locking with class table inheritance. I put the version column in the base table. When I perform change a base entity value, persist, and flush, the version in memory does not update to match the new version in the base table. Consequently, subsequent updates fail with "The optimistic lock on an entity failed." As far as I can tell, the reason is that the update method in Doctrine/ORM/Persisters/JoinedSubclassPersister.php does not call assignDefaultVersionValue in this case. This change appears to fix the problem. --- a/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php +++ b/lib/Doctrine/ORM/Persisters/JoinedSubclassPersister.php @@ -227,9 +227,10 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister // Make sure the table with the version column is updated even if no columns on that // table were affected. - if ($isVersioned && ! isset($updateData[$versionedTable])) { - $this->_updateTable($entity, $this->quoteStrategy->getTableName($versionedClass, $this->_platform), array(), true); - + if ($isVersioned) { + if (! isset($updateData[$versionedTable])) { + $this->_updateTable($entity, $this->quoteStrategy->getTableName($versionedClass, $this->_platform), array(), true); + } $id = $this->_em->getUnitOfWork()->getEntityIdentifier($entity); $this->assignDefaultVersionValue($entity, $id); } The new code then looks like this:
// Make sure the table with the version column is updated even if no columns on that
// table were affected.
if ($isVersioned) {
if (! isset($updateData[$versionedTable])) {
$this->_updateTable($entity, $this->quoteStrategy->getTableName($versionedClass, $this->_platform), array(), true);
}
$id = $this->_em->getUnitOfWork()->getEntityIdentifier($entity);
$this->assignDefaultVersionValue($entity, $id);
}
|
[DDC-1690] Notify policy listeners are not attached to entities with Notify policy Created: 08/Mar/12 Updated: 22/Dec/12 Resolved: 22/Dec/12 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.1.1 |
| Fix Version/s: | 2.3.2 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Oleg Namaka | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Description |
|
It seems that it happens because the UnitOfWork::addToIdentityMap() is not the only way to add an entity to the identity map. It is possible to do it directly by assigning array values (pulling my hair why?) . But the code in that method also adds a property changed listener to an entity. As a result that entity is not persisted properly as it does not have a listener. I spent a lot of time trying to figure out why some of my entities were persisted and others no. That happens for entities of same class with parent - children associations. Probably the notify policy is not very popular otherwise the bug would have been reported long time ago. Adding these lines to the UnitOfWork at line 2004 fixes the issue: // PERF: Inlined & optimized code from UnitOfWork#registerManaged() $newValueOid = spl_object_hash($newValue); $this->entityIdentifiers[$newValueOid] = $associatedId; $this->identityMap[$targetClass->rootEntityName][$relatedIdHash] = $newValue; // new lines -- if ($newValue instanceof NotifyPropertyChanged) { -- $newValue->addPropertyChangedListener($this); -- } //end of new lines $this->entityStates[$newValueOid] = self::STATE_MANAGED; // make sure that when an proxy is then finally loaded, $this->originalEntityData is set also! |
| Comments |
| Comment by Guilherme Blanco [ 15/Mar/12 ] |
|
Changing the code (Perf & Inline block) to this: $this->registerManaged($newValue, $associatedId, array($field => $newValue));
Also fixed the issue and the performance impact was around 3% during my tests. |
| Comment by Oleg Namaka [ 16/Apr/12 ] |
|
So Doctrine 2.2.2 is out but the fix for this serious issue was not included in it. What version then it is supposed to fix? Doctrine seems to be riddled with issues related to the Notify strategy (look here for another related issue: http://www.doctrine-project.org/jira/browse/DDC-1775). It renders that strategy unusable. |
| Comment by Patrick Schwisow [ 20/Dec/12 ] |
|
Submitted a pull request for this fix: https://github.com/doctrine/doctrine2/pull/541 |