mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-122: Not specifying a Metadata Cache at all leads to fatal error in EM #154
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 6, 2009).
Jira issue originally created by user @beberlei:
If for development purposes you dont follow the recommendation to use a Metadata Cache you end up with a fatal error, because the EntityManager sets the null value of the metadata cache to the ClassMetadataFactory which issues a command on it.
Solutions
@doctrinebot commented on GitHub (Nov 7, 2009):
Comment created by @guilhermeblanco:
If no metadata cache is defined, it should always use the array cache.
It should not throw the exception!
@doctrinebot commented on GitHub (Nov 7, 2009):
Comment created by romanb:
An exception is much better. Just silently using an array cache can hide a serious performance problem... The metadata cache is declared as *REQUIRED* in the documentation, hence you must specify it.
@doctrinebot commented on GitHub (Nov 7, 2009):
Comment created by romanb:
ArrayCache is actually *worse than using no metadata cache at all!. Thus we might instead consider turning a metadata cache from *required to recommended. That means, of course, that no exception should be thrown if it is not set.
@doctrinebot commented on GitHub (Nov 16, 2009):
Comment created by romanb:
Not specifying a metadata cache actually works fine for me.
Is this the problematic code you're referring to?
So this would only be problematic in preload mode which we want to remove for A4 anyway. Would that be correct?
@doctrinebot commented on GitHub (Nov 17, 2009):
Comment created by @beberlei:
yes correct, please remove it :)
@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 16, 2009):
Comment created by @beberlei:
Hm, shouldn't we deprecate and the Respective other File driver options? It seems otherwise the class name has to be specified twice, once as filename, once as attribute in XML or YAML.
@doctrinebot commented on GitHub (Dec 16, 2009):
Comment created by romanb:
No, I think that is fine. The file drivers just make use of the naming convention in order to not load/parse the file to get at the class name. IMHO the class name should always be present in the mapping document.
@doctrinebot commented on GitHub (Dec 16, 2009):
Comment created by @beberlei:
But we should at least throw an exception if filename and entity name don't match, this probably kills 95% of support and debugging time in this matter.