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

fix circular dependency for AerospikePersistenceEntityIndexCreator #357

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

Aloren
Copy link

@Aloren Aloren commented Mar 30, 2022

No description provided.

@Aloren Aloren added the bug label Mar 30, 2022
@Aloren Aloren changed the title WIP fix circular dependency for AerospikePersistenceEntityIndexCreator fix circular dependency for AerospikePersistenceEntityIndexCreator Mar 30, 2022
@Aloren Aloren changed the title fix circular dependency for AerospikePersistenceEntityIndexCreator WIP fix circular dependency for AerospikePersistenceEntityIndexCreator Mar 30, 2022
@Aloren
Copy link
Author

Aloren commented Mar 31, 2022

relates to:
aerospike-community/spring-data-aerospike-starters#108
spring-projects/spring-data-commons#2587

To resolve the issue with circular dependency, I've done the following:

  • IndexCreator now does not use aerospikeMappingContext in onApplicationEvent. Because aerospikeMappingContext is the one, that produces these events. It means that when indexCreator receives MappingContextEvent from aerospikeMappingContext --- aerospikeMappingContext field in indexCreator is currently being initialised :)
  • instead IndexCreator saves events and processes them only in start method, when aerospikeMappingContext is finally initialised.
  • remove createIndexesOnStartup from aerospikeMappingContext as it can not be used in IndexCreator, and moved it to AerospikeDataSettings
  • i've created MappingContextEvent source makes spring-data modules create circular dependencies spring-projects/spring-data-commons#2587 ticket to address that currently linking indexCreator to specific mappingContext is quite cumbersome and requires dirty workarounds (providing linked mappingContext via ObjectProvider and using it only after initialisation is complete).

@Aloren Aloren changed the title WIP fix circular dependency for AerospikePersistenceEntityIndexCreator fix circular dependency for AerospikePersistenceEntityIndexCreator Mar 31, 2022
@roimenashe roimenashe requested review from reugn and roimenashe March 31, 2022 08:46
@Aloren
Copy link
Author

Aloren commented Mar 31, 2022

Let's merge?
And also can you please release. I think it should be 3.4.0. WDYT?

@roimenashe
Copy link
Member

roimenashe commented Mar 31, 2022

@Aloren If we bump spring then it's definitely 3.4.0.
1 more thing before we merge and release 3.4.0, check the latest email, I think that we need to bump spring-data-parent, spring-data-commons and spring-data-keyvalue as well (from 2.5.6 to 2.6.3 [latest]), am I missing something?

@Aloren
Copy link
Author

Aloren commented Mar 31, 2022

Thanks. Will check now which spring-data-parent is expected to come with SB 2.6

@Aloren
Copy link
Author

Aloren commented Mar 31, 2022

All 3 PRs for spring-data-* updates need to be merged as well.

@Aloren
Copy link
Author

Aloren commented Mar 31, 2022

let's merge them separately:
#350
#351
#352

@Aloren
Copy link
Author

Aloren commented Mar 31, 2022

since you are already upgrading spring-cloud-starter-bootstrap and spring-boot-starter-test?

I've upgraded them, because they were causing an issue that is fixed in this PR.

@roimenashe roimenashe merged commit fe9bbae into main Mar 31, 2022
@reugn reugn deleted the feature/fixes-circular-dependency branch February 14, 2023 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants