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

Children not persisted when created in doctrine event listener #654

Open
dbu opened this issue Aug 10, 2015 · 1 comment
Open

Children not persisted when created in doctrine event listener #654

dbu opened this issue Aug 10, 2015 · 1 comment

Comments

@dbu
Copy link
Member

dbu commented Aug 10, 2015

@petforsberg reported originally in doctrine/DoctrinePHPCRBundle#179

Within my app, when I create an Article, app auto-generates a News for it. Both (Article and News) have their own children-nodes attached (always).
The workflow looks like this:

  1. persist Article
  2. Doctrine EventListener - Article postPersist: create children, and set their Parent as Article
  3. Doctrine EventListener - Article postPersist: EventDispatcher -> generate News (creates new News document inside the other service)
  4. persist News (in the same service)
  5. Doctrine EventListener - News postPersist: create children, and set their Parent as News

Points 1-4 work well. But children persisted to another persisted Document - News - seem to be not persisted at all. I checked everything, it took me like 4 hours or so. Everything looks fine, objects are created, persisted, they exist... until I do flush. Then News children-elements disappear.

Do you know why does it happen?

Forgot to mention: when I create a bare News (not auto-generated in the nested Doctrine events), it is created without a problem, with its children.

@dbu
Copy link
Member Author

dbu commented Aug 10, 2015

see doctrine/DoctrinePHPCRBundle#179 for previous discussion

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

No branches or pull requests

1 participant