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

feat: Reconfigurable DataManagers for some Entity types #3825

Closed

Conversation

ikaakkola
Copy link
Contributor

Allow (re)configuration of the DataManagers of various EntityManager implementations, at runtime, via MutableEntityManager interface.

This change allows the implementation of custom DataManagers without having to reinitialize all EntittManagers or use reflection to set the new DataManager into each EntityManager instance. This matches the expectation that after calling one of the setDataManager methods, the given DataManager is really used, also by the existing entity manager.

Check List:

  • Unit tests: NA
  • Documentation: NA

@ikaakkola
Copy link
Contributor Author

The changes to also set datamanagers in the entitymanager instances make maintaining the "In Memory DataManagers" implementation (#3531) easier as a separate module.

@ikaakkola ikaakkola force-pushed the feature/mutable-entity-managers branch from a30ed96 to 823df96 Compare January 22, 2024 12:56
@filiphr
Copy link
Contributor

filiphr commented Jan 23, 2024

@ikaakkola why is it not possible to just set the data manager on the appropriate engine configuration?

e.g. when you want to configure a custom data manager you'll just set it on the ProcessEngineConfigurationImpl in EngineConfigurator#beforeInit

Allow (re)configuration of the DataManagers of various EntityManager
implementations, at runtime, via MutableEntityManager interface.

This change allows the implementation of custom DataManagers without
having to reinitialize all EntittManagers or use reflection to set
the new DataManager into each EntityManager instance. This matches
the expectation that after calling one of the setDataManager methods,
the given DataManager is really used, also by the existing entity
manager.
@ikaakkola ikaakkola force-pushed the feature/mutable-entity-managers branch from 823df96 to f1ab4d7 Compare January 23, 2024 13:11
@ikaakkola
Copy link
Contributor Author

@ikaakkola why is it not possible to just set the data manager on the appropriate engine configuration?

e.g. when you want to configure a custom data manager you'll just set it on the ProcessEngineConfigurationImpl in EngineConfigurator#beforeInit

Thank you. I was so stuck on not being able to override datamanagers in the entitymanagers I never realised I could do it at a separate time (though this does require some changes in my custom DataManager implementations as they have some inter-datamanager relations to accomplish what is normally done at the database level).

@filiphr
Copy link
Contributor

filiphr commented Jan 24, 2024

(though this does require some changes in my custom DataManager implementations as they have some inter-datamanager relations to accomplish what is normally done at the database level).

Not sure how you are doing this in your module. However, you could get the other data managers through the engine configuration. We are doing that in some of our entity managers, e.g. in

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