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

Possible delete of an object due reading from MongoDB #1

Closed
naiyerasif opened this issue Oct 25, 2020 · 4 comments
Closed

Possible delete of an object due reading from MongoDB #1

naiyerasif opened this issue Oct 25, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@naiyerasif
Copy link
Collaborator

In GitLab by @CyberpunkPerson on Oct 24, 2020, 07:44

In CascadeMongoEventListener onAfterConvert event could be invoke during reading what is leads that objects could be deleted due reading

Example:

  1. get (something) by id method in repository has been invoked
  2. onAfterConvert has been invoked
  3. child objects have been deleted
  4. game over
@naiyerasif naiyerasif added the bug Something isn't working label Oct 25, 2020
@naiyerasif naiyerasif self-assigned this Oct 25, 2020
@naiyerasif
Copy link
Collaborator Author

Fixed in 123ade5

@CyberpunkPerson
Copy link

Hi, naiyerasif. It's up to you, of course, but by this commit you broke Service Stateless Principle which in you case leads to data inconsistency 😊

@naiyerasif
Copy link
Collaborator Author

naiyerasif commented Oct 26, 2020

I am aware of that as well since I've to resort to store deletedAccount across the lifecycle. The guide was supposed to showcase how the cascading could be done, if needed. Any attempt to do so will fail one way or the other as long as it not natively supported 😄 I will add a warning in that implementation explicitly mentioning the problem it may cause with state.

@CyberpunkPerson
Copy link

As I said it's up to you, it's your guide anyway. I looked for solution before I saw your's and did not find anything decent. Moreover even extending and overriding of existed Mongo components impossible, because of bad design of Mongo developers. Mongo components can be extended, but methods can not be overridden, because parameters have package private modificators.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants