DDC-428: "Not fully loaded proxy can not be serialized." #534

Closed
opened 2026-01-22 12:41:44 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Mar 16, 2010).

Jira issue originally created by user jakajancar:

I'm trying to serialize an entity and am getting the above error.

I don't get it, why doesn't it just fully load it then?

Originally created by @doctrinebot on GitHub (Mar 16, 2010). Jira issue originally created by user jakajancar: I'm trying to serialize an entity and am getting the above error. I don't get it, why doesn't it just fully load it then?
admin added the Bug label 2026-01-22 12:41:44 +01:00
admin closed this issue 2026-01-22 12:41:45 +01:00
Author
Owner

@doctrinebot commented on GitHub (Mar 16, 2010):

Comment created by romanb:

Because that would result in recursively pulling out huge parts of your database and serialize a huge object graph. Where should the automatic loading end? Doctrine cant know. You should "cut" the object graph to your needs before serializing it.

Serializing objects in PHP is btw. pretty flawed in many ways and it gets worse with entities. Make sure you also read this: http://www.doctrine-project.org/documentation/manual/2_0/en/architecture#entities:serializing-entities.

Summary: **sleep is flawed and Serializable is even more flawed :) If you still want to serialize entities, cut the associations (nulling out) that you dont want serialized and explicitly (lazy) load the associations you do want serialized.

ps. The user or dev mailing list is the preferred way to ask questions.

@doctrinebot commented on GitHub (Mar 16, 2010): Comment created by romanb: Because that would result in recursively pulling out huge parts of your database and serialize a huge object graph. Where should the automatic loading end? Doctrine cant know. You should "cut" the object graph to your needs before serializing it. Serializing objects in PHP is btw. pretty flawed in many ways and it gets worse with entities. Make sure you also read this: http://www.doctrine-project.org/documentation/manual/2_0/en/architecture#entities:serializing-entities. Summary: **sleep is flawed and Serializable is even more flawed :) If you still want to serialize entities, cut the associations (nulling out) that you dont want serialized and explicitly (lazy) load the associations you do want serialized. ps. The user or dev mailing list is the preferred way to ask questions.
Author
Owner

@doctrinebot commented on GitHub (Mar 16, 2010):

Issue was closed with resolution "Can't Fix"

@doctrinebot commented on GitHub (Mar 16, 2010): Issue was closed with resolution "Can't Fix"
Author
Owner

@doctrinebot commented on GitHub (Aug 5, 2010):

Comment created by @beberlei:

Our opinion on this changed and serializing is now possible after this ticket implementation, http://www.doctrine-project.org/jira/browse/DDC-518

@doctrinebot commented on GitHub (Aug 5, 2010): Comment created by @beberlei: Our opinion on this changed and serializing is now possible after this ticket implementation, http://www.doctrine-project.org/jira/browse/[DDC-518](http://www.doctrine-project.org/jira/browse/DDC-518)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#534