[DDC-954] Look into deferring foreign key checks until flush finished Created: 28/Dec/10  Updated: 23/May/12  Resolved: 23/May/12

Status: Resolved
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: 2.3
Security Level: All

Type: Improvement Priority: Major
Reporter: Benjamin Eberlei Assignee: Guilherme Blanco
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
is required for DDC-959 Problem deleting when the foreign ke... Resolved
DDC-890 Association mapping 'One-To-Many, Sel... Sub-task Resolved Guilherme Blanco  
DDC-369 Bulk-Delete on Self-Referencing CTI f... Sub-task Resolved Guilherme Blanco  


There are several timing issues that will be complicated to fix which relate to foreign key checks.

If we could optionally allow people to defer the foreign key checks until flush has fully completed we could simply solve them all, maybe even across all vendors?

Comment by Benjamin Eberlei [ 29/Dec/10 ]

Postgresql: http://stackoverflow.com/questions/139884/how-do-i-disable-referential-integrity-in-postgres-8-2
Mysql: http://cristian-radulescu.ro/article/disable-foreign-key-checks-in-mysql.html
Oracle: http://infolab.stanford.edu/~ullman/fcdb/oracle/or-triggers.html#deferring%20constraint%20checking
Mssql: No clue?!
Sqlite: no foreign key support (yet)
DB2: not researched (IBM should provide better DB2 support for PHP first).

Comment by Guilherme Blanco [ 23/May/12 ]

As per https://github.com/doctrine/doctrine2/commit/3e601c3a53226ce981fe82db164f297a8d605ae7 all tests related to this issue are closed.
Marking this ticket as fixed on 2.3.

Generated at Wed Nov 25 18:46:11 EST 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.