Skip to content

DATACMNS-1067 - Fix not to call @AfterDomainEventPublication method from Collection of entities. #216

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

Closed

Conversation

sis-yoshiday
Copy link
Contributor

@sis-yoshiday sis-yoshiday commented May 15, 2017

  • You have read the Spring Data contribution guidelines.
  • There is a ticket in the bug tracker for the project in our JIRA.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

I've fixed below ticket, please review.
https://jira.spring.io/browse/DATACMNS-1067

@odrotbohm
Copy link
Member

One thing I am kind of puzzled about is the mismatch between the fix and the description in the original ticket. The ticket claims a problem with save(Iterable) being called. The fix however deals with the events that are potentially to be emitted. Can you clarify?

@odrotbohm
Copy link
Member

I think I got it. The essential fix referring to the ticket is that the object that the clearing method is invoked on is the aggregate root, not the parameter object. However, I am now unsure about the change to only clear the events if they have been exposed. This is a feature we can discuss, but it's not something I would want to couple with the fix for the issue described in the ticket.

@sis-yoshiday
Copy link
Contributor Author

sis-yoshiday commented May 15, 2017

Yes, we should call clearingMethod even if events are empty.
I'll fix it tomorrow.

@odrotbohm
Copy link
Member

Thanks for clarifying. Already at it :).

@odrotbohm odrotbohm self-assigned this May 15, 2017
odrotbohm pushed a commit that referenced this pull request May 15, 2017
…rom collection of entities.

We now make sure the event cleanup method is called on the aggregate root, not on the parameter object directly (as the latter might be a collection.

Original pull request: #216.
odrotbohm added a commit that referenced this pull request May 15, 2017
Revert change to only invoke cleanup method if events have been exposed. We now again invoke the cleanup method for every aggregate. Changed the publication of events from the aggregate instances that were handed into the method to the ones the save method returns as the save call might return different object instances.

Cleanups in the unit tests. Moved newly introduced methods to the bottom of the test case class. Extracted method to set up mock method invocation.

Original pull request: #216.
odrotbohm pushed a commit that referenced this pull request May 15, 2017
…rom collection of entities.

We now make sure the event cleanup method is called on the aggregate root, not on the parameter object directly (as the latter might be a collection.

Original pull request: #216.
odrotbohm added a commit that referenced this pull request May 15, 2017
Revert change to only invoke cleanup method if events have been exposed. We now again invoke the cleanup method for every aggregate. Changed the publication of events from the aggregate instances that were handed into the method to the ones the save method returns as the save call might return different object instances.

Cleanups in the unit tests. Moved newly introduced methods to the bottom of the test case class. Extracted method to set up mock method invocation.

Original pull request: #216.
odrotbohm pushed a commit that referenced this pull request May 15, 2017
…rom collection of entities.

We now make sure the event cleanup method is called on the aggregate root, not on the parameter object directly (as the latter might be a collection.

Original pull request: #216.
odrotbohm added a commit that referenced this pull request May 15, 2017
Revert change to only invoke cleanup method if events have been exposed. We now again invoke the cleanup method for every aggregate. Changed the publication of events from the aggregate instances that were handed into the method to the ones the save method returns as the save call might return different object instances.

Cleanups in the unit tests. Moved newly introduced methods to the bottom of the test case class. Extracted method to set up mock method invocation.

Original pull request: #216.
@odrotbohm odrotbohm closed this May 16, 2017
Aloren pushed a commit to Aloren/spring-data-commons that referenced this pull request Jun 20, 2019
…us-codes

Retry requests on specified status codes.  Fixes spring-projects#215.
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

Successfully merging this pull request may close these issues.

2 participants