[DDC-2090] MultiTableUpdateExecutor works incorrect with query cache enabled Created: 19/Oct/12 Updated: 17/Mar/13 Resolved: 17/Mar/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | 2.4, 2.3.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Valera Leontyev | Assignee: | Fabio B. Silva |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Doctrine\ORM\Query\Exec\MultiTableUpdateExecutor works incorrect with query cache enabled. There is todo-task in code: //FIXME (URGENT): With query cache the parameter is out of date. Move to execute() stage. This is important issue. Much time spent in debugging. |
| Comments |
| Comment by Valera Leontyev [ 19/Oct/12 ] |
|
Workaround is to disable query cache per every multitable update query: http://stackoverflow.com/questions/12969460/doctrine-query-cache-update |
| Comment by Fabio B. Silva [ 17/Mar/13 ] |
|
Fixed : https://github.com/doctrine/doctrine2/commit/60b8bc63a1a4819cf112cfbbc7cca06b5792aba6 |
| Comment by Benjamin Eberlei [ 17/Mar/13 ] |
|
Merged into 2.3 for release with 2.3.3 |
[DDC-1666] orphanRemoval does not work with oneToOne: Duplicate entry Error Created: 23/Feb/12 Updated: 14/Mar/13 Resolved: 14/Mar/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.2 |
| Fix Version/s: | 2.3.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Mario Knippfeld | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | None | ||
| Description |
|
orphanRemoval does not work with oneToOne. Mysql Error /*
Error:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'UNIQ_9D8DDB05579B502F'
*/
Models and YAML Mapping
/*
Contact:
type: entity
table: contact
fields:
_id:
id: true
type: integer
unsigned: true
nullable: false
generator:
strategy: AUTO
column: id
oneToOne:
_standingData:
targetEntity: StandingData
mappedBy: _contact
cascade: ["persist", "merge", "remove"]
orphanRemoval: true
*/
class Contact
{
private $_id;
private $_standingData;
public function newStandingData(StandingData $sd)
{
$this->_standingData = $sd;
$sd->setContact($this);
}
}
/*
StandingData:
type: entity
table: standing_data
fields:
_id:
id: true
type: integer
unsigned: true
nullable: false
generator:
strategy: AUTO
column: id
oneToOne:
_contact:
targetEntity: Contact
inversedBy: _standingData
joinColumns:
contact_id:
referencedColumnName: id
onDelete: cascade
*/
class StandingData
{
private $_id;
private $_contact;
public function setContact(Contact $c)
{
$this->_contact = $c;
}
}
Script // Create new Contact $contact = new Contact(); $contact->newStandingData(new \StandingData()); $em->persist($contact); $em->flush(); // Try to change StandingData $contact->newStandingData(new \StandingData()); $em->flush(); |
| Comments |
| Comment by Benjamin Eberlei [ 14/Mar/12 ] |
|
This is a necessary restriction for the internals of Doctrine to always work correctly. |
| Comment by Albert Casademont [ 12/Apr/12 ] |
|
+1 on this one. So what's the point of orphanRemoval in OneToOne if it can never be done? Maybe onetoones should not create a unique index but a normal one. If it is really a won't fix, then the docs should reflect that. |
| Comment by Albert Casademont [ 12/Apr/12 ] |
|
BTW, as a workaround, i suggest converting this OneToOne case (where the orphanRemoval is in the inverse side) into a ManyToOne so a normal index will be created, not a unique one. Then the new row is inserted fine and the old one is deleted afterwards. |
| Comment by Mario Knippfeld [ 04/May/12 ] |
|
+1 |
| Comment by Matthieu Napoli [ 11/Feb/13 ] |
|
+1 same for me If the example of the docs isn't supposed to work (i.e. orphanRemoval with oneToOne isn't supported), then the docs should be updated. I can do a PR, but I need you to confirm it's really the case Benjamin Eberlei. |
| Comment by Benjamin Eberlei [ 14/Mar/13 ] |
|
Its indeed a good fix to disable the unique constraint if orphan removal isset. |
| Comment by Benjamin Eberlei [ 14/Mar/13 ] |
|
Fixed and merged into 2.3 With the change Doctrine will not create unique indexes anymore on Orphan Removal OneToOne associations. You need to change the database schema for this change to take effect essentially. |
[DDC-2300] Xmldriver does not convert the version field to boolean but keeps it as a SimpleXMLElement which breaks serialization Created: 16/Feb/13 Updated: 14/Mar/13 Resolved: 14/Mar/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | Mapping Drivers |
| Affects Version/s: | 2.3.2 |
| Fix Version/s: | 2.3.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Jaco Stienstra | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Serialization breaks because the cache driver tries to serialize the ClassMetaData instance containing a simplexml element: Doctrine\ORM\Mapping\ClassMetadata Object ( [fieldMappings] => Array ( [version] => Array ( [fieldName] => version [type] => integer [columnName] => version [version] => SimpleXMLElement Object ( [0] => true ) [default] => 1 [declared] => path to entity ) The fix is simple change in the columnToArray method in the XML driver class: changing: $mapping['version'] = $fieldMapping['version']; to:
$mapping['version'] = $this->evaluateBoolean($fieldMapping['version']);
|
[DDC-2323] [GH-593] Fix SimpleObjectHydrator behavior when column not exists in fieldMappings, relationMappings and metaMappings Created: 28/Feb/13 Updated: 14/Mar/13 Resolved: 14/Mar/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.3 |
| 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 norzechowicz: Url: https://github.com/doctrine/doctrine2/pull/593 Message: https://github.com/doctrine/dbal/commit/88c1975dda492f3dd93cddea71ebacb40ed7efa5 change seems to make unable to use ``findOneBy()`` method because of ``doctrine_rownum`` added to query. ``findOneBy()`` throws: >Notice: Undefined index: doctrine_rownum in |
[DDC-2340] Using Criteria matching on non-initialized collections ignore changes made on loaded entities Created: 07/Mar/13 Updated: 12/Mar/13 Resolved: 12/Mar/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | 2.3 |
| Fix Version/s: | 2.3.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Matthieu Napoli | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
Given:
If you do a matching using a Criteria on the collection (http://docs.doctrine-project.org/en/latest/reference/working-with-associations.html#filtering-collections), then the Criteria will be executed through a DB query. But the fields you changed are not updated in the DB, so if you filter/order on those fields, then the result of the filter() will be incorrect. However, if your collection was initialized, the Criteria matching will be done in memory on the ArrayCollection and the result will be correct. So we have the problem for Criteria filtering on non-initialized collections. |
| Comments |
| Comment by Benjamin Eberlei [ 12/Mar/13 ] |
|
Fixed and merged for 2.3.3 |
[DDC-2341] [GH-606] Don't add empty Expr to another one Created: 08/Mar/13 Updated: 12/Mar/13 Resolved: 12/Mar/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.3 |
| 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 jean-gui: Url: https://github.com/doctrine/doctrine2/pull/606 Message: Doctrine should not allow to add an empty Expr to another one. Current code allows that, which can lead to wrong DQL. Example 2: IRC log of the discusion on #doctrine: |
| Comments |
| Comment by Benjamin Eberlei [ 12/Mar/13 ] |
|
A related Github Pull-Request [GH-606] was closed |
[DDC-2282] [GH-572] Fixed SQLServer ORDER BY problem in paginator CountOutputWalker Created: 07/Feb/13 Updated: 12/Mar/13 Resolved: 12/Mar/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.3 |
| 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 norzechowicz: Url: https://github.com/doctrine/doctrine2/pull/572 Message: Code explains everything |
[DDC-2310] Recent changes to DBAL SQL Server platform lock hinting breaks ORM SqlWalker in DQL queries with joins Created: 21/Feb/13 Updated: 21/Feb/13 Resolved: 21/Feb/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | Git Master |
| Fix Version/s: | 2.3.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Critical |
| Reporter: | William Schaller | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | dbal, lockhints, orm, sqlserver, sqlsrv | ||
| Environment: |
SQL Server |
||
| Description |
|
The SQL Server platform throws an error when you try to run DQL with JOIN statements. The breaking change was in the DBAL SQL Server platform – it was changed to add a ' WITH (NOLOCK)' to the appendLockHint function. Change was in this rev. The change in DBAL is not wrong, it just highlighted the bug in the ORM... The ORM SqlWalker runs the appendLockHint function against a generated FROM / JOIN clause in the walkFromClause func here. This is actually the wrong place to append lock hints. This is generating the FROM clause like: FROM foo f0_ LEFT JOIN foo_bar f1_ ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ ON f1_.bar_id = b2_.id WITH (NOLOCK) When it should actually generate something like: FROM foo f0_ WITH (NOLOCK) LEFT JOIN foo_bar f1_ WITH (NOLOCK) ON f0_.id = f1_.foo_id LEFT JOIN bar b2_ WITH (NOLOCK) ON f1_.bar_id = b2_.id It should append lock hints after the table alias. I think the only reason this hasn't shown up before is that the other lock hint types haven't been applied in this way before, if at all. |
| Comments |
| Comment by Christophe Coevoet [ 21/Feb/13 ] |
|
I think the line appending the lock should be moved to this place to achieve the result displayed above. But it may cause issues with some other vendor. |
| Comment by William Schaller [ 21/Feb/13 ] |
|
@Christophe I considered that too. None of the other platforms implement the appendLockHint function. None of the other platforms implement this because it is handled differently on other platforms – with transaction isolation levels and such. |
[DDC-2243] Inconsistent PHP Type for "bigint" columns Created: 15/Jan/13 Updated: 20/Jan/13 Resolved: 20/Jan/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | Johannes Schmitt | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
It seems like columns of type "bigint" have no consistent PHP type. If an object is read from the database, the database value seems to be cast to I think it would make sense to use a PHP string for both cases as you otherwise can run into problems if you use shallow comparisons such as "===". |
[DDC-2246] ORM\UnitOfWork::getEntityState() crash when using a new Entity with association composite key Created: 17/Jan/13 Updated: 20/Jan/13 Resolved: 20/Jan/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | ORM |
| Affects Version/s: | 2.3.2 |
| Fix Version/s: | 2.3.3 |
| Security Level: | All |
| Type: | Bug | Priority: | Major |
| Reporter: | keks nicoh | Assignee: | Benjamin Eberlei |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
I already found a similar issue report but it seems to be not solved completely: http://doctrine-project.org/jira/browse/DDC-1382 I did something like this (mock): (Metadata cache is OFF) // Note: $userEntity & $anotherRelationEntity are managed by UOW. $uow = $em->getUnitOfWork(); – EXPECTED: – – ACTUAL RESULT: – As you see the metadatainfo tries to convert the composite objects to strings, instead of getting the identifiers from the objects. greetz |
| Comments |
| Comment by Benjamin Eberlei [ 20/Jan/13 ] |
|
Fixed and merged into 2.3.x branch |
[DDC-2231] [GH-546] The EntityManager was not injected in uninitialized proxys which are Obj... Created: 10/Jan/13 Updated: 12/Jan/13 Resolved: 12/Jan/13 |
|
| Status: | Resolved |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.3 |
| 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 stefankleff: Url: https://github.com/doctrine/doctrine2/pull/546 Message: ...ectManagerAware. I ran into that problem while I had two objects in the identitymap while hydrating a collection: one was new a "real" entity and the other one was an uninitialized proxy. For "real" entities the em is injected in line 2427, for new entities it is injected in 2436->2364, but for proxies this is missing. According to the comment "inject ObjectManager into just loaded proxies." the code in line 2427 should do this, but in fact it is just used if it is a "real" entity or an already initialized proxy. Moving the injection to outside of the condition in line 2411 (if the entity is an unitialized proxy) solves this. |
| Comments |
| Comment by Benjamin Eberlei [ 12/Jan/13 ] |
|
A related Github Pull-Request [GH-546] was closed |