Skip to content

Instantly share code, notes, and snippets.

@wjzijderveld
Created November 29, 2012 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wjzijderveld/4167640 to your computer and use it in GitHub Desktop.
Save wjzijderveld/4167640 to your computer and use it in GitHub Desktop.
Doctrine: SingleTable Inheritance, ClassMetaData, APC problem
I'll try to explain:
We have ProductTaxonomyTerm and CategoryTaxonomyTerm, which both extend BaseTaxonomyTerm.
BaseTaxonomyTerm is configured with SingleTableInheritance with a discriminator column type.
Local env works without issues, but on our staging it sometimes happens, that the ClassMetaData is 'corrupt'.
The Base/Category (in this example) metadata looks fine (when I look at the value stored in APC), but the ProductTaxonomyTerm has no parentClasses defined anymore (in ClassMetadata).
Apache graceful (APC clear) solves the issue, but only half. The problem re-arises on another website (we have a mutli-site solution), which site it is, seems pure random.
The missing parentClasses causes, that Doctrine generates a faulty SQL query (empty WHERE IN()).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment