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

Review asynchronous EntityManagerFactory bootstrapping and DataSource initialisation #14658

Open
wilkinsona opened this issue Oct 2, 2018 · 2 comments
Labels
status: blocked An issue that's blocked on an external project change theme: datasource Issues relating to data sources type: task A general task

Comments

@wilkinsona
Copy link
Member

When the EntityManagerFactory is bootstrapped asynchronously, the DataSourceSchemaCreatedEvent is published off the main thread. This means that any data scripts will be applied off the main thread as well. I think a consequence of this is that the application context may have completed refreshing before the DataSource is fully initialised. I think we need to confirm if this is the case and then decide if the behaviour is acceptable.

@wilkinsona wilkinsona added this to the 2.1.x milestone Oct 2, 2018
@wilkinsona wilkinsona added type: task A general task for: team-attention An issue we'd like other members of the team to review labels Oct 2, 2018
@wilkinsona
Copy link
Member Author

At least part of this behaviour is due to Framework allowing application context refresh to complete before the bootstrapping of the entity manager factory has completed. This creates a race condition where, after context refresh completing, the state of the database is unknown. For example, Hibernate may have initialised the database's schema or it may not. I've opened SPR-17334.

@philwebb philwebb added the status: blocked An issue that's blocked on an external project change label Oct 4, 2018
@wilkinsona
Copy link
Member Author

The Framework issue has been moved to the 5.x backlog. That ties our hands quite a bit. My feeling is that we may just have to live with this. I'm reluctant to add something ourselves that will be superseded by something in Framework at some point with no guarantee that it would have exactly the same behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: blocked An issue that's blocked on an external project change theme: datasource Issues relating to data sources type: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants