DDC-98: SchemaToolTask's use of Driver\preload() is not "deterministic" #121

Closed
opened 2026-01-22 12:27:55 +01:00 by admin · 6 comments
Owner

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().

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().
admin added the Bug label 2026-01-22 12:27:55 +01:00
admin closed this issue 2026-01-22 12:27:55 +01:00
Author
Owner

@doctrinebot commented on GitHub (Nov 2, 2009):

@doctrinebot commented on GitHub (Nov 2, 2009): - is referenced by [DDC-97: \Doctrine\ORM\Mapping\Driver\Driver::preload($force=false) is missing](http://www.doctrine-project.org/jira/browse/DDC-97)
Author
Owner

@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 2, 2009): Comment created by @beberlei: Attached a patch that relies on the patch in [DDC-97](http://www.doctrine-project.org/jira/browse/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
Author
Owner

@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 (Nov 3, 2009): Comment created by romanb: Scheduled for ALPHA4 where we will probably get rid of PRELOAD as a regular operating mode.
Author
Owner

@doctrinebot commented on GitHub (Dec 15, 2009):

Comment created by romanb:

PRELOAD mode removed. ClassMetadataFactory#getAllMetadata introduced.

@doctrinebot commented on GitHub (Dec 15, 2009): Comment created by romanb: PRELOAD mode removed. ClassMetadataFactory#getAllMetadata introduced.
Author
Owner

@doctrinebot commented on GitHub (Dec 15, 2009):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 15, 2009): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2015):

Imported 1 attachments from Jira into https://gist.github.com/e9e6a20999b36ef05811

@doctrinebot commented on GitHub (Dec 13, 2015): Imported 1 attachments from Jira into https://gist.github.com/e9e6a20999b36ef05811 - [10127_ddc_98.diff](https://gist.github.com/e9e6a20999b36ef05811#file-10127_ddc_98-diff)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#121