开发者

Doctrine\ODM\MongoDB\Query\Builder serialization breaks mongo connection

I have an object that has an instance of Doctrine\ODM\MongoDB\Query\Builder . When I serialize my object, unserialize it, and then try to use the Builder, I get the following error:

Fatal error: Uncaught exception 'MongoException' with message 'The MongoCursor object has not been correctly initialized by its constructor'

I assume that this is because PHP 开发者_开发问答looses its connection to the mongo server in the serialization process. How can I fix this?


You can't. The only thing you can do is to remove that object on serialization and create a new one on unserialization. See the serializable interface in PHP.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜