[DDC-561] Metadata caching broken due to incomplete __sleep functions Created: 30/Apr/10  Updated: 30/Apr/10  Resolved: 30/Apr/10

Status: Closed
Project: Doctrine 2 - ORM
Component/s: Mapping Drivers
Affects Version/s: None
Fix Version/s: 2.0-BETA2
Security Level: All

Type: Bug Priority: Critical
Reporter: Nico Kaiser Assignee: Roman S. Borschel
Resolution: Fixed Votes: 0
Labels: None

Attachments: Text File ddc-561.patch    

 Description   

When using a persistent Metadata cache, the serialized ClassMetadata objects are not complete.

This leads to very strange behavior since not all Metadata is loaded in the next request (which uses cached Metadata). The problem is that the __sleep methods of Doctrine\ORM\Mapping\AssociationMapping and Doctrine\ORM\Mapping\ClassMetadata are note complete (missing "namespace", "fetchMode" properties).



 Comments   
Comment by Nico Kaiser [ 30/Apr/10 ]

This patch fixes the issue for AssociationMapping and ClassMetadata. I'm not sure if there are more properties missing...

Comment by Roman S. Borschel [ 30/Apr/10 ]

Ouch, bad oversight. Sorry for that. We do actually have tests for serializing and unserializing the metadata, obviously not enough... will fix it asap.

Comment by Roman S. Borschel [ 30/Apr/10 ]

Fixed in http://github.com/doctrine/doctrine2/commit/db2be55e27c87fa513073b2bf44456f1d1423582 .

Thanks for your help.

Comment by Benjamin Eberlei [ 30/Apr/10 ]

Should we re-release Beta1? This is pretty serious and might annoy people

Comment by Roman S. Borschel [ 30/Apr/10 ]

Hehe, no its fine. You can easily patch it manually if needed and beta2 is only a few weeks away.

Comment by Roman S. Borschel [ 30/Apr/10 ]

And you can just use HEAD and not the tag, of course

Generated at Thu Dec 18 21:01:06 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.