Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serialisation of uninitialised PersistentCollection instances #1929

Merged

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jan 14, 2019

Q A
Type bug
BC Break no
Fixed issues Fixes #1864, Replaces #1914

Summary

This ensures that any internal data from PersistentCollection instances are serialised to have a usable collection instance after serialisation. This affects the mongoData and snapshot properties along with isDirty and hints.

Ping @watari

@alcaeus alcaeus added the Bug label Jan 14, 2019
@alcaeus alcaeus added this to the 1.2.6 milestone Jan 14, 2019
@alcaeus alcaeus self-assigned this Jan 14, 2019
@malarzm
Copy link
Member

malarzm commented Jan 14, 2019

I still think that using unserialised PersistentCollection is a can of worms but this is better than #1914 :)

@alcaeus alcaeus force-pushed the fix-persistent-collection-serialisation branch from 004a7ae to 4097963 Compare January 15, 2019 08:20
@alcaeus alcaeus merged commit 4de0a04 into doctrine:1.2.x Jan 15, 2019
@alcaeus alcaeus deleted the fix-persistent-collection-serialisation branch January 15, 2019 08:49
@watari
Copy link
Contributor

watari commented Jan 22, 2019

Hi there. Sorry for delay. First of all - thank you for PR with fix :)
But still PersistentCollection is unusable after serialization since It does not have link to UoW and cannot perform hydration of raw data. I agree with @malarzm , that PersistentCollection should not be serialized since it will be broken after unserialization.

I propose just to forget about this issue until it do not brake anything :)

About my PR - it was bad in general and I did not count references. In such way I fixed it for my projects and it was worked for me.
I think that this issue will be really actual when implementation of results caching in lib will begin.

@malarzm
Copy link
Member

malarzm commented Jan 22, 2019

@watari for the record, unserialised collection will have UnitOfWork if you call ->setDocumentManager()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants