mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-98: SchemaToolTask's use of Driver\preload() is not "deterministic" #121
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Nov 2, 2009).
Jira issue originally created by user @beberlei:
\Doctrine\ORM\Mapping\Driver\Driver::preload() only returns the diff of loaded entities, however for example ClassMetadataFactory::setCacheDriver() already calls preload() which may make the SchemaToolTask find zero entities.
preload() should be executed, however it should be done from a new preload() method on ClassMetadataFactory() and then all the loaded classes should be fetched from the ClassMetadataFactory by calling getLoadedMetadata().
@doctrinebot commented on GitHub (Nov 2, 2009):
@doctrinebot commented on GitHub (Nov 2, 2009):
Comment created by @beberlei:
Attached a patch that relies on the patch in DDC-97.
It adds a preload($force=false) method on the ClassMetadataFactory, and changes the setCacheDriver() to use that method also.
This now allows to consistently preload() drivers into the class metadata factory without "loosing" entities, which is required in SchemaTool Task.
The patch also changes the SchemaTool Task to use ClassMetadataFactory::preload() and ClassMetadataFactory::getLoadedMetadata().
All Tests still pass on Sqlite, Mysql and Postgres
@doctrinebot commented on GitHub (Nov 3, 2009):
Comment created by romanb:
Scheduled for ALPHA4 where we will probably get rid of PRELOAD as a regular operating mode.
@doctrinebot commented on GitHub (Dec 15, 2009):
Comment created by romanb:
PRELOAD mode removed. ClassMetadataFactory#getAllMetadata introduced.
@doctrinebot commented on GitHub (Dec 15, 2009):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 1 attachments from Jira into https://gist.github.com/e9e6a20999b36ef05811